Tumblr - Facebook post like status statistics - php

I want to implement the following features.
From my server I want to write a script which will authenticate a user's tumblr and facebook account and will extract
like statistics comparison data
from corresponding posts.
Anyone have any ideas.
I tired to extract the information using the tumblr API but did not get any useful information to fulfill the requirements

Tumblr likes are classed as post notes.
From the API documentation you can get post note information as follows:
http://api.tumblr.com/v2/blog/BLOGNAME.tumblr.com/posts?id=XXXX&notes_info=true
Adding the parameter notes_info=true will return the note / like count.

Related

Get Facebook post's comments using graph API by post URL

I like to get comments of a post by its URL but it seems its impossible by using graph API.
From my observations, I could find these types of posts URLs:
https://www.facebook.com/bbwbooks/photos/a.168788885097.122872.74209335097/10153736545150098/?type=3&theater
https://www.facebook.com/4thirteengroup/posts/1285218878169361
https://www.facebook.com/groups/semsari.malezi/permalink/1159959294084128/
or perhaps some other types.
Is there any idea, how its possible to get comments or at least the ID of the post from the url?
First use facebook developer section https://developers.facebook.com/tools/explorer/1021611514583622?method=GET&path=me%2Fposts%3Ffields%3Did%2Cobject_id%2Ccomments&version=v2.7
Select Application ,
Get access_token with user_posts access rights,
me/posts?fields=id,object_id,comments by calling this api ,you will get all posts with their comments

Get my posts on facebook manage page

I need get ME posts in one of my manage pages, with the new version of facebook sdk.
Example:
I'm manage on Page A, and add a post in my name Adexe Rivera, and in this page there are a lot of posts. So I want to filter only posts by Adexe Rivera.
I know for get posts on pages it's necesary /page/feed, but I need add the filter from user.
I tried with Graph Api Explorer, with this FQL:
SELECT source_id, actor_id, post_id, target_id, message FROM stream WHERE source_id = "PAGE_ID" AND actor_id = "MY_ID"
and get the information that I'm searching.
But I know that since v2.0 FQL not works for sdk, so that I need it's make the same like FQL works in this version of graph
I already tried what documentation said, but not get my posts.
A user access token is required to retrieve posts visible to that person.
Thanks in advance
Filtering is not possible, you can only use the existing endpoints and filter on your own after getting the entries. There are several different endpoints, make sure you are using the correct one. They are all documented very well: https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed
Also, an App Access Token should be enough to get access to the endpoints if it´s a public post on a non-restricted Page:
An access token is required to view publicly shared posts.
If you don´t know about Access Tokens, read those articles:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Finally, it is not possible to use FQL giving me the expected result, so getting the "from" field in the /PAGEID/feed endpoint, and filtering the results, I get what I wanted.
Thanks for your answers and for their penalties, I have spent several days trying to maximize the performance of the SDK facebook.
Cheers

Twitter oembed for timelines?

Hi I use the following code to embed tweets but I am wondering if there is away as simple as the following to embed user profiles, I can't seem to find it on dev.twitter.com they keep taking me to make a widget. which is what I want to do but I want them to do it on request of the PHP
Currently i use something like this. But as you can see from below it only gets the status and not the timeline of the user.
$status = file_get_contents("https://api.twitter.com/1/statuses/oembed.json?url=".$links[$j]);
$stats = json_decode($status);
//$string = "https://api.twitter.com/1/statuses/oembed.json?url=".$links[$j];
if(isset($stats->errors))
{
}
else
$string=str_replace($links[$j],''.$links[$j].'',$string).$stats->html;
}
You can't get the html of users timeline, like you are getting it for status.
There is no end point with oembed available for users profile.
But you can easily build it yourself by following these steps.
Register an application
Get the API keys and access token
Use some library for PHP from these listed in this page Twitter Libraries, I would prefer going with the abraham's library
Get the user details by making request to this URL:
https://api.twitter.com/1.1/users/show.json?screen_name=[screen_name]
*Note: Twitter API v1 is deprecated so use API v1.1 for making requests
Fetch the JSON response and render it in your html code

How to retrieve the category-specific fields from a facebook page using facebook graph api?

In facebook developers api page it says:
A Page in the Graph API.
The fields shown below are some of the common fields of Facebook Pages. Pages may also contain other (or additional) category-specific fields.
Does anyone know how to retrieve those additional category-specific fields???
I´ve been looking on Internet but not a clue :-(
The doc for the facebook 'page' table shows fields and lists what category of page they are available to:
https://developers.facebook.com/docs/reference/fql/page/
For example, the band pages have a 'band_members' field that no other page type has. You should also check out Facebook Graph API batch requests which you can use to query for something and use the result in a second request using JSONPath notation. Do a search on this page for JSONPath and you'll see it near the bottom under the 'Specifying dependencies between operations in the request' section:
https://developers.facebook.com/docs/reference/api/batch/
Hope that helps!
-Kyle

Selecting specific fields with facebook graph api

I'd like to fetch statuses from users facebook newsfeed via the graph API.
It seems to be pretty simple when I have the right access token, then I can fetch this data with http://graph.facebook.com/home... But I want to fetch only statuses; no links, photos, videos and so on..
On the documentation page, I've seen many possibilities to specify selected data, for example I can limit obtained count of posts. Is there any possibility to control which data will be particularly fetched and which not? For example like graph.facebook.com/home?type="status"..
I can classify it in my PHP script, but then I need to be able to fetch a few more posts, like when I click on the more button on facebook or twitter, etc..I see some pagination data in Facebook JSON(I hope it's JSON:)), but I am propably not capable to use it in right way..
Thanks for your help!!
The doc page http://developers.facebook.com/docs/api says:
The Graph API allows you to read properties and connections of the Facebook social graph. You can use the API to read specific fields, get pictures of any object, introspect an object for metadata and get real-time updates on any changes.
...and...
You can choose the fields (or connections) you want returned with the "fields" query parameter. For example, this URL will only return the id, name, and picture of Ben: https://graph.facebook.com/bgolub?fields=id,name,picture

Categories