i give the keyword can you crawl thru twitter and Facebook to see how many mentions does that have in the past half hour?
can we do that using php ?
For Twitter: https://dev.twitter.com/rest/reference/get/statuses/mentions_timeline
For Facebook it´s not possible. The Public Post Search API is deprecated: https://developers.facebook.com/docs/apps/changelog
Public Post search is no longer available.
But you would not get "mentions" anyway. Afaik there is no API on Facebook to get the number of mentions.
There is this one, but only for partners: https://developers.facebook.com/docs/hashtag_counter/v2.1
...not really "mentions" though, just hashtags.
Related
I guess there is no answers for my question, but i want try anyway :)
I'm moving my app from the V1 API to the V2. (i'm using the Facebook PHP SDK but this is not important). As the FQL is now deprecated, i want to remove all my previous code that used it.
The last thing i can't perform with the graph API is an old call to the url_like FQL table : i just want to see if the user likes a given URL (which is not a Facebook page) or not.
Is there anyway to do it without FQL ?
Thanks !
There is no way to do this with the Graph API afaik. BUT: Never try to hide Like Buttons because the user liked something already. The user should always be able to unlike at the exact same location where he liked something.
I work with Facebook API SDK. I'm trying to get all public photos using https://graph.facebook.com/search?access_token=xxxx|xxxxx&q=%23hashtag&type=post
But I have a problem: result contains only shared photos in first account. When i'm posting photo without share, search not found it.
Otherwise, I have another account where I'm posted photo and share it, but photo is not found too.
Who knows, how can I get all public photos with hastag using FQL or graph search
Addition:
Few days ago - facebook search is not working
After discussing with facebook developers, I got the answer:
Facebook API does not support searching for hashtags.
%23 is just the URL encoded version of a # which gets decoded on a
server generally so it still won't work. For example if I wanted to
search for #YOLO I would just say q=YOLO with no # or it's URL encoded
form.
It's just something that the api doesn't support at the moment
Facebook has officially deprecated the post search type. Im not sure when exactly but I can tell you I tried today (10/15/2014) and its a no go.
I am trying to find in Facebook API if they provide the HashTag search.
I meant I search in Facebook Query language and searched in Facebook Tool Explorer.
Any Idea ?
Since April 30th and the introduction of Facebook api v2.0, public Post search is no longer available and will return :
{
"error": {
"message": "(#11) Post search has been deprecated",
"type": "OAuthException",
"code": 11
}
}
According to Facebook changelog v1.0 will continue to work until April 30th, 2015. As the search endpoint is back in the v2 doc, there is hope that they will reconsider the deprecation.
The search endpoint is a fulltext search, you just have to encode the hash (%23) and run your query through it :
Facebook API explorer :
You have to select v1.0 or Unversioned in the API version selector (on the top right)
https://graph.facebook.com/search?type=post&q=%23the_hash_tag
Curl or whatever :
Just remove /v2.0/ from the url and call the unversioned API
https://graph.facebook.com/search?access_token=YOUR_TOKEN&type=post&q=%23the_hash_tag
There is currently no API for the hashtags feature on Facebook
There is a posts search function which will return some posts with a certain hashtag if you use that hashtag as the search string. But it will ignore the # tag.
There is a comment on one of the sites which says "you can change the # with the hex value from the ascii table (%23) to search for hashtags. but it will only find tags, created by the facebook homepage or official facebook applications." Not sure how valid, you could try it
like this https://graph.facebook.com/search?q=%23myhashtag
https://graph.facebook.com/search?q=%23myhashtag
There is no hashtag API available for Facebook and using %23 for #(hash) is the only solution as of now which already everyone here has commented upon.
I'm not too sure about FQL being deprecated in near future as I could see different opinions across the board.
As I am understanding you would use Keyword Insights API
Though as mentioned on the following link
Access to the Keyword Insights API is restricted to a limited set of
media publishers and usage requires prior approval by Facebook. You
cannot apply to use the API at this time.
https://developers.facebook.com/docs/keyword_insights/
Take note on the mention of hashtag searching in the "best practices" section.
I am new to facebook api. I want to search for a particular word on facebook. I have gone through the documentation at https://developers.facebook.com/docs/reference/api/. But I dont know how to construct the query in PHP.
Could any one please provide a sample code. Also how do I specify the count and page (like twitter)?
I am currently using the API provided by facebook. I saw that there are alternative API's but I would like to restrict the API to the official one
Facebook provides the search functionality which is like searching using the search inside facebook.com.
To read about it go to here: http://developers.facebook.com/docs/reference/api/#searching
Edit
As it states in that document:
When searching for public posts or posts on the user's News Feed, you
can page over the results by using the since, until and limit
parameters. since and until both accept a unix timestamp.
Also, just a bit above the "searching" section there's the "Paging" section, using both you can come up with:
https://graph.facebook.com/search?q=coffee&type=place&offset=X&limit=4
Which in terms of using the php sdk, is probably like: "search?q=coffee&type=place&offset=X&limit=4"
Hey, I was wondering if it is possible to search Facebook using their API for a given URL. I am trying to find how many people are mentioning a given link.
An example of what I am trying to achieve is the Tweetmeme url_info request but for Facebook. The Tweetmeme API returns an array of imformation about a given link, such as frequency used and last tweeted.
If anyone knows of a Facebook alternative, it would be greatly appreciated. I have a look throught their API wiki but can't find any solutions.
Thanks in advance, Ben
I recently stumblued upon this hidden gem when building an SEO tool:
http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http://stackoverflow.com/
It's an old API, but you can confirm the counts are up-to-date by checking this against their new Graph API that only gives you the total count:
https://graph.facebook.com/?ids=http://stackoverflow.com/
While researching the answer from Vance Lucas I came accross the FQL equivilent # http://developers.facebook.com/docs/reference/fql/link_stat
$facebook->api_client->fql_query('SELECT share_count, like_count, comment_count, total_count FROM link_stat WHERE url="MY_URL"');
This FQL Statment returns the "Share Count", "Link Count", "Comment Count" and "Total Count".
Check the Graph API Overview page of the Facebook Developers documentation, under the subheading "Searching". It indicates you can use the Graph API to search all public posts for a given query:
https://graph.facebook.com/search?q=<your_url_here>&type=post
(Be sure to URL-encode your URL first.)
This will retrieve a JSON array containing mentions of your URL. It appears not to provide any metadata about the search, but is rather a paginated list of search results, so you'd have to build the metadata yourself.