Aug 02, 2011 Display Google Plus Posts On Your Site

This is a very simple PHP function that will call your most recent public post on Google Plus.

Just copy the code below and replace the numeric string in the 'simplexml_load_file' with yours.

Finding your Google Plus id

Hint: If you're not sure where your Google+ ID is, just login to your account and view your profile. You'll see it in the url

function gPlus(){
	$xml = simplexml_load_file('http://plusfeed.appspot.com/106274972321613013294');
	$post = $xml->entry->title;
	return $post;
}

Note: If you like to see everything in the xml file, you can output this code to grab the nodes you want. Feel free to tinker with it and return any data in the file.

	$xml = simplexml_load_file('http://plusfeed.appspot.com/106274972321613013294');
	print_r($xml);

If you have any questions, comments, or anything you would like to add let me know in the comments below.

Comments
Post a comment