Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I manipulate this unofficial Google+ API to return a simple array of followers instead of write the data to a db?
    text
    copied!<p>So after some research I realized the Official Google+ API is very simple and incomplete not allowing you much. However, I did find a few resources, one in particular which seems to be a homegrown unofficial Google+ API built in PHP. Few issues with it all though. For one, I noticed after some hunting through the files I quickly confused myself and after a little bit had no idea what was truely needed since a lot of things are provided there and I am only looking for one small aspect of what is provided. I also realized (having familiarity with SQL) that it appears most of these tools write the information to a db, something I definitely do not require.</p> <p>All I need at this point is some help weeding through all the code/files to do just the following and no more really. I want to display the first 24 (don't care which 24 or if they change, although if they changed every time on refresh that would be even better) people that have a specified G+ ID in their circles. The format for display should be 3 rows of 8 thumbnails, 32px by 32px, with 3px gutter between each thumbnail and the users first &amp; last name as the img tag title. That's it, nothing more, nothing less.</p> <p>Can someone please point me in the right direction here or provide me some sample code that either starts me off or demonstrates how this can be accomplished with the work already provided by the Unofficial API that I provided the link for below? I'm a little lost at this point :/</p> <p><a href="https://github.com/jmstriegel/php.googleplusapi" rel="nofollow">https://github.com/jmstriegel/php.googleplusapi</a></p> <p>All I really need here is someone to help me get the image URL &amp; Full Name into an array with the least amount of code and in the most efficient manner from the PHP provided already in the API found at that link. I can take it from there...</p> <p><em><strong>UPDATE:</em></strong></p> <p>SO I got going on this finally and got it all working without any errors but realized nothing was being returned in the array. So I went back and traced the process through code and discovered this unofficial API was built around the concept that G+ was returning JSON data. Google probably got wise to this and removed the data tags making the returned data invalid JSON, so of course the function decode_json() returns nothing.</p> <p>HOWBVER, it still does return the data I am looking for... the URI (seems the first one is the full URL.. not sure if this is because that is an individual or what) for the photo I seek and their name! I don't care about anything else. Here is what is returned after the data is cleaned via the function CleanGoogleJSON() in GoogleUtil.php >> <a href="https://github.com/jmstriegel/php.googleplusapi/blob/master/lib/GooglePlus/GoogleUtil.php" rel="nofollow">https://github.com/jmstriegel/php.googleplusapi/blob/master/lib/GooglePlus/GoogleUtil.php</a></p> <p>(BTW, the following code I hand added return characters to make the data more easily understood. In reality, there are no return characters and it presents as one big string)</p> <pre><code>[ [ "tsg.lac", [], [ [ [null,null,"100829745667958569941"], [], ["Amanda Grider",null,null,null,"4b3347c83f0a1","8nwbFHob02C8CmojHF","BoZrAHx801Rz8o3h8k",null,"https://lh3.googleusercontent.com/-zIK8ZN_ZDt8/AAAAAAAAAAI/AAAAAAAAAAA/fsiR92bLDlU/photo.jpg",null,1,"Marina del Rey, CA",null,null,null,0,null,[],null,null,null,""], [] ],[ [null,null,"115014076410206782853"], [], ["VWvortex",null,null,null,"4b13c6667b3c9","JKCGFo_CApJ","JKCGFo_CApJ",null,"//lh6.googleusercontent.com/-X_wSt8nwpOU/AAAAAAAAAAI/AAAAAAAAACQ/R_jcIPcegbM/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://WWW.VWVORTEX.COM",null,null,3],null,null,"World's largest Volkswagen enthusiast community and blog."], [] ],[ [null,null,"102608018926739248428"], [], ["Wale",null,null,null,"4b1ded89a3721","JmRxAk","JmRxAk",null,"//lh4.googleusercontent.com/-xyeyjc4Avow/AAAAAAAAAAI/AAAAAAAAABU/SY-9EKeDnhw/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://www.ralphfolarin.com/",null,null,6],null,null,""], [] ],[ [null,null,"114161985228080012446"], [], ["The Opus Rhythm Music Blog",null,null,null,"4b177a5207d09","IIJj03C4Iog3HIKMIIJz02xEHnRf01ZxFnB","IIJj03C4Iog3HIKMIIJz02xEHnRf01ZxFnB",null,"//lh5.googleusercontent.com/-4QRl1IgDCLU/AAAAAAAAAAI/AAAAAAAAABI/pVoxTQ7SH8Y/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://www.bacchusentertainment.com",null,null,6],null,null,"We are the team music blog of Bacchus Entertainment"], [] ],[ [null,null,"114645267718535118440"], [], ["Jalopnik",null,null,null,"4b12fccb6f809","DHRxFoK0Cng","DHRxFoK0Cng",null,"//lh6.googleusercontent.com/-_M1nn9mKyY8/AAAAAAAAAAI/AAAAAAAAABI/aXhkyN7cuuk/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://jalopnik.com/",null,null,3],null,null,"Jalopnik: Drive Free or Die"], [] ],[ [null,null,"105503202599719238167"], [], ["Audi USA",null,null,null,"4b14db7535e99","8owhCkGEHmR","8owhCkGEHmR",null,"//lh3.googleusercontent.com/-mHHyVhWfARE/AAAAAAAAAAI/AAAAAAAAAC4/Qn0lYbilT8M/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://www.audiusa.com","(800) 822-2834",null,3],null,null,"Progress is social media, and listening, and fans, and Google+. So here we are."], [] ],[ [null,null,"104108787932235341403"], [], ["Audi Sport",null,null,null,"4b23243c864b1","8owhCkGAGJC8IF","8owhCkGAGJC8IF",null,"//lh4.googleusercontent.com/-jGBNL9dbwYs/AAAAAAAAAAI/AAAAAAAAAUA/pgsAqvaX8XM/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://www.facebook.com/AudiSportPage",null,null,6],null,null,"Unofficial Audi Sport fan page, not affiliated with or endorsed by Audi AG."], [] ],[ [null,null,"106689856342933829975"], [], ["Volkswagen USA",null,null,null,"4b20ca9b7fa69","JJBxDohI8nBjFFGEHmR","JJBxDohI8nBjFFGEHmR",null,"//lh5.googleusercontent.com/-i3MO9CsymQ8/AAAAAAAAAAI/AAAAAAAAAB4/ddmTW3D8s20/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://www.vw.com","(800) 822-8987",null,3],null,null,"Take a look around, kick the tires, ask questions and get to know our community."], [] ],[ [null,null,"115425298803319911308"], [], ["Internal Frequency",null,null,null,"4b177b6d46119","Co4CAo_08no3BJZjGowjFHhM","Co4CAo_08no3BJZjGowjFHhM",null,"//lh4.googleusercontent.com/-lZeecuGL3Ig/AAAAAAAAAAI/AAAAAAAAABk/Afv5eGuBzUM/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://www.internalfrequency.com",null,null,6],null,null,"The 1st hand ups-and-downs of the CEO of an up-and-coming entertainment label in Southern California"], [] ],[ [null,null,"101358795463286919640"], [], ["Music Think Tank",null,null,null,"4b1947fea8251","EoxACmg3IIJrFIg3IHS0Dk","EoxACmg3IIJrFIg3IHS0Dk",null,"//lh4.googleusercontent.com/-B2KTfl4uNyE/AAAAAAAAAAI/AAAAAAAAACM/N955ZhPV08E/photo.jpg",null,1,null,null,null,null,0,null,[],[null,"http://www.musicthinktank.com",null,null,6],null,null,"Where the music industry speaks out loud. Create the Chaos."], [] ] ] ] ] </code></pre> <p>What would be the best way to parse this data string to capture the Full Nsme and the jpg image URL (accounting for the fact some have the https: in front and some don't) so I can use the array directly in constructing the data in my HTML the way I talked about earlier?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload