Tuesday 15 January 2013

php - Pinterest Followers display -


How am I showing Wordpress to my Pinterest followers? I tried but it only shows the button to follow users to my account, nothing about my followers.

Perhaps, I can do this using Pinterest API, but I am unsure where to start from.

Any help would be appreciated.

Yes, you can use the Pinterest API to install Curl and use it in PHP script. Example:

  $ ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, 'http://pinterestapi.co.uk/""yourname"""/likes'); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ CH, CURLOPT_CONNECTTIMEOUT, 0); $ Json = curl_exec ($ ch); Curl_close ($ ch);   

Something like this is supposed to be returned in such a way that "Your name" "is your Pinterest account name:

  {" body ": [" Href ":" http://pinterest.com/pin/150026231307331200/ "," Source ":" http://media-cache-ec3.pinterest.com/upload/228979962274567868_qVshovBS_b.jpg "," desc ":" # "", "User": "Luis Earl", "Medium": "Chris Mitchell", "Board": "Ideal"}, {"href": "http://pinterest.com/pin/287104544965407998/" "Source": "http://media-cache-ec8.pinterest.com/upload/287104544965407998_z3kbynbX_b.jpg", "desc": "hipsters vs old people", "user": "Lucy Folix", "medium": Wrong "board": "cool"}], "meta": {"count": 2}}   

Since There is a Jason string you will need to decode it

  $ count = json_decode ($ json, true); $ Count = $ count ['meta'] ['count'];   

I do not know that curl is available while hosting your site on WordPress, but it may be worth a try in your case that the "count" in that string is probably what you want .

No comments:

Post a Comment