Google+ API Embedded Posts (Javascript && PHP)! Issues?

Hello,

I have been looking 4 a script to get RSS feed 4 my site.

I just found a new one and would like 2 use this instead of the other ones.

Getting error msg:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\Hosting\10140828\html\gbot\feed.php on line 9

Any help would b appreciated! :slight_smile:

<?php
header('Content-type: text/xml');
$gendate = date('r', time());
$config = array(
	'gplusid' 	=> '108889088632131119238',
	'gplusname' => 'Robert Rodriguez',
	'hosturl' 	=> 'http://http://www.gbot.nyc/'
);
$data = file_get_contents("https://plus.google.com/_/stream/getactivities/?&sp=[1,2,$config['gplusid'],null,null,10,null,\"social.google.com\",[]]");
//remove first shits
$parsed = str_replace(")]}'", "", $data);
//convert
$parsed = str_replace('[,' , '["",' , $parsed);
$parsed = str_replace(',,' , ',"",' , $parsed);
$parsed = str_replace(',,' , ',"",' , $parsed);
$parsed_data 	= json_decode($parsed);
$stream 		= $parsed_data[0][1][0];
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title><?= $config['gplusname'] ?> on Google+</title>
	<atom:link href="<?= $config['hosturl'] ?>" rel="self" type="application/rss+xml" />
	<link>https://plus.google.com/<?= $config['gplusid'] ?>/posts</link>
	<description><?= $config['gplusname'] ?> has a Google+ account, and he's making an RSS feed of his postings there</description>
	<lastBuildDate><?= $gendate ?></lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator><?= $config['gplusname'] ?>'s G+ RSS generator</generator>
	
<?php for($a = 0; $a < 10; $a++): ?>
	<item>
		<title><?= $stream[$a][4] ?></title>
		<link><?= $stream[$a][21] ?></link>
		<comments><?= $stream[$a][21] ?>#comments</comments>
		<pubDate><?= date('r', (int)($stream[$a][5] / 1000) ?></pubDate>
		<dc:creator><?= $config['gplusname'] ?></dc:creator>
		<description><![CDATA[<?= isset($stream[$a][11][0][3]) ? $stream[$a][11][0][3] : '' ?>]]></description>
	</item>
<?php endfor; ?>
</channel>
</rss>
1 Like