I'm using the Joomla 1.5 Feed module to display Tweets on my website. Now it suddenly doesn't work anymore (it was still working yesterday). Is anyone aware of any changes Twitter made in their syntax or anything? I'm using the following line to get the tweets: http://search.twitter.com/search?q=from%3AUsername
This API has now been retired:
Requests to search.twitter.com/search.* will receive HTTP 410 Gone. Use GET search/tweets instead.
note also that:
JSON is API v1.1's only output format. XML, RSS, and ATOM response formats will be retired along with API v1.
Related
I'm experimenting with the Mendeley API to upload and retrieve documents and files and have a problem with the files/{file_id} endpoint.
I have a personal Mendeley account I'm using for testing, populated with some PDF documents.
For example, on the API documentation page if I call
GET /files
I see all the files I've added, but if I take an id value, then call
GET /files/{file_id}
using the ID, e.g.
https://api.mendeley.com:443/files/7b188de2-32a7-f067-51bd-520179e866b8
I get a strange response code of 0, response headers is {}, response body is 'no content'. This happens with all the ids from the file listing - is this a bug or am I doing something wrong?
If I alter the id string, I get a 404 Not found error, which is to be expected, so it's not an authorisation or other general issue.
It's a limitation of Swagger, the software that's used to run the API documentation web page.
That endpoint returns a redirect to an S3 download URL, to allow you to grab the file. Unfortunately Swagger doesn't handle the redirect properly, and it shows it as a response code of 0.
The endpoint is working correctly; it's just not displaying properly on the documentation page.
I've went through most of the beginner rails books and I want to try creating something on my own. For a start, I just want to create a few pages in rails that will get from Facebook's api and display something like username, likes, post. I've searched around and couldn't find an answer. My friend recommended that I use a gem called fb_graph, but reviewing the documentation, I have no clue how to use it.
Thanks stackoverflow!
You can query the Graph API directly. The responses will be in JSON which you can then parse into Ruby hash. See the Facebook Documentation for more details on to call specific and sample JSON responses. So here is general guide how to you can start playing around with this:-
Make a API Call to Facebook using Graph API
Explorer. Keep playing around with api until you get a response you want. Note the request params you passed to get that response & JSON you received from facebook.
Send a HTTP request containing those same params in rails using koala, 'fb_graph' or just plain NET:HTTP. It doesn't matter what client you use to sent the request, as long as you send same params as in step1, you will get that familar JSON as response.
Now, once you have the json, just have to parse it. Provided, if the client library is not already doing that as most fb gems will turn JSON into ruby objects/hashes. But if they don't, then you have to do it manually, its something like JSON.parse('JSON_RESPONSE_AS_STRING_GOES_HERE'). after this you will have a plain-old ruby hash which is you can save to db, display in view or whatever you want to do.
Hope it helps
I'm not really sure where to begin with this.
Prior to the upgrade to version 1.1 of the API I was able to request tweets in XML format using
$url = 'http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=' . $TWITTER_USERNAME;
A couple of things have changed, the return format is now JSON which isn't a problem but I'm not sure how to authenticate my app to request the tweets in JSON format.
I've read this link but am unsure how I'm supposed to implement it.
For instance, where do I get the consumer secret from ?
How do I request a bearer token in PHP ?
Any pointers would be great
you need to use plugin that is written for v1.1, In new version they have added security layer so you need to be authorized in order to get the tweets via API, here are the links that will be helpful for you
http://www.webdevdoor.com/php/authenticating-twitter-feed-timeline-oauth/ http://www.fullondesign.co.uk/coding/2516-how-use-twitter-oauth-1-1-javascriptjquery.htm
I wish to get tweets with a keyword. But There is no result with any keyword.
http://search.twitter.com/search.json?q=summer
How to get results with Twitter Search API?
Version 1 of the twitter API has been deprecated and is being removed. Not sure how you can miss the giant warnings on the twitter dev site ;) This means simple code like the above will not work any more.
So, you now need to make authenticated requests (OAuth) using the 1.1 API, and it's nowhere near as simple as just doing a (in PHP) file_get_contents(http://search.twitter.com/ ...).
I couldn't see any server-side languages you use from your profile, but I wrote a lengthy post explaining the issue (with pictures) and how to use a php library to perform authenticated requests.
I am currently tinkering with STRAVA API (Strava is a site for logging, sharing and comparing GPS tracklogs taken during cycling and running activities).
In order to get the streams (sample logs) of an activity like this:
http://www.strava.com/rides/9999
one can use the Version 1 of the API like this:
http://www.strava.com/api/v1/streams/9999
which returns a json string with time-series of speed, position, heartrate, etc.
My problems are:
Is there a way to get streams using API v2?
Where is the documentation for API v1?
Docs for API v2 are here
I've read somewhere that there are differences between POST and GET methods of the API, and that some data require authentication, but I am still (yet more) confused...
Thanks for any help!
UPDATE:
For anyone arriving here, as for end of 2013 Strava has (not) released their rather closed V3 API, and shut down their V1 and V2 endpoints.
However, it's still possible to get the JSON streams of a given activity with URLs like these (using activity of Id 9999 as a working example):
http://app.strava.com/stream/9999
http://app.strava.com/activities/9999/streams
Be aware that these APIs are being deprecated. Here is link to both versions of the API documentation, and a place to sign up for notification about the new API coming in early 2013.
You will find that the REST style is only loosely followed for these versions of the API, thus your confusion is understandable. The new API follows the REST style much more rigorously. For V1 and V2 GET of a resource will usually return an the object representing that resource in json format. However there are cases where POST returns the object rather than creating one. Streams are not returned by the V2 API, only V1. IHTH