Created
July 27, 2011 12:17
-
-
Save shin1x1/1109232 to your computer and use it in GitHub Desktop.
php.googleplusapi sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('lib/GooglePlus/GoogleUtil.php'); | |
define('GPLUS_ID', 'GOOGLE PLUS ID'); // Google+ ID を入れる | |
$url = 'https://plus.google.com/_/profiles/get/'.GPLUS_ID; | |
//$ret = GoogleUtil::FetchGoogleJSON($url); | |
$ret = json_decode(GoogleUtil::CleanGoogleJSON(file_get_contents($url))); | |
$posts = $ret[1][4][0]; | |
foreach ($posts as $post) { | |
//var_dump($post);exit; | |
// 3: 名前 | |
// 4: 本文(HTMLタグ) | |
// 73.16: +1 | |
// 21: permlink | |
// 25: share(0:氏名、1:gplusId) | |
// 47: share時コメント | |
echo 'name='.$post[3].PHP_EOL; | |
echo 'share post='.$post[47].PHP_EOL; | |
echo 'post='.$post[4].PHP_EOL; | |
echo '+1='.$post[73][16].PHP_EOL; | |
echo 'share='.count($post[25]).PHP_EOL; | |
echo PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment