How can I get the XML file from Twitter API user_timeline - objective-c

I am new with the twitter API, How can I get the XML format from my twitter account?
I was trying https://api.twitter.com/1.1/statuses/myusername.xml
I am changing the "myusername" to my actual username but it's showing bad access. ALso, I'm going to fetch from XCode.
Thanks for helping

Twitter doesn't provide XML format with the 1.1 API, they used to offer XML on version 1.
To see your own timeline the URL you need to call is https://api.twitter.com/1.1/statuses/home_timeline.json
Before that link works as expected you will need to authenticate yourself via OAuth using application keys you must generate at https://dev.twitter.com/ and following the instructions here: https://dev.twitter.com/docs/auth/authorizing-request
You should look for a library in objective-c that helps you to do this in a simpler way, https://dev.twitter.com/docs/twitter-libraries

Related

Twitter API V2 video url

I'm trying to fetch a tweet's video url using API V2.
Using API V1.1 I can use
https://api.twitter.com/1.1/statuses/show.json?id=<ID>&include_entities=true
and get the direct mp4 urls in the response at
extended_entities.media[0].video_info.variants
But using API V2 I can't seem to find any ways to get those, I was only able to get the video thumbnail but not the actual video.
I've tried it with both the lookup and the recent search endpoints but couldn't find a way to do that.
In lookup docs twitter says:
This endpoint was recently graduated from Twitter Developer Labs, and is the replacement of v1.1 statuses/show, v1.1 statuses/lookup, and Labs Tweet lookup. If you are currently using any of these endpoints, you can use our migration materials to start working with this new endpoint.
but that doesn't seem to be the case, is that feature not included ? Also if there is any other way to be able to embed a twitter video in a web page (without the tweet text) that'd be helpful.
The videos are not currently available in the Twitter API v2 at this time. This is a known request.
For those who still looking for an answer, you can do it on the V2 by adding the following parameters :
expansions=attachments.media_keys
media.fields=variants
Your final link should give https://api.twitter.com/2/users/{{uid}}/tweets?expansions=attachments.media_keys&media.fields=variants
Source : https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/media
Progress on twitter-api-v2 media handling, Maybe this will allow the video URLs too in the response.
https://twittercommunity.com/t/v1-1-media-endpoints-available-for-essential-access-in-the-twitter-api-v2/171664

setPermissions on files using SkyDrive API

We would like to interface our cloud app with storage on user's SkyDrive. Has anyone worked out how to emulate sharing with the SkyDrive API. As far as I can tell it's not supported in the public API apis.live.net/v5.0 but of course the SkyDrive site itself is doing this using an API call like;
POST https://skydrive.live.com/API/2/SetPermissions
...
Content-Type:application/x-www-form-urlencoded
...
{"id":"F2720F142345635B!207","entities":[{"role":2,"type":0,"email":"someuser#somedomain.com"}],"requireSignIn":true,"userAction":0}:
As far as I can tell, this isn't what happens when we use the JavaScript API wl.api() Is skydrive.live.com/api OK to use or would this be an unsupported/illegal hack? I would dearly love a contact on the SkyDrive team to give an official response on this.
The API does provide a way to get a unique link to the file for reading or editing
GET https://apis.live.netv5.0/file.a6b2a7e8f2515e5e.A6B2A7E8F2515E5E!126
/shared_read_link?access_token=ACCESS_TOKEN
or
GET https://apis.live.netv5.0/file.a6b2a7e8f2515e5e.A6B2A7E8F2515E5E!126/shared_edit_link?access_token=ACCESS_TOKEN

Twitter API access to similar_to functionality?

Is there any way to programatically access, through the Twitter API or otherwise, the data from the list of handles from the similar_to page? (e.g. https://twitter.com/#!/similar_to/aplusk).
Scraping as always is least desirable with dynamic javascript sites like Twitter.
It's there, it's just currently undocumented:
https://api.twitter.com/1/users/recommendations.json?user_id=783214
Looking at the request, these parameters are supported:
connections: Includes extended network connections in the data structure. For example, connections=true
limit: Limit the number of entries. For example, limit=3
user_id: The user ID to get recommendations for. For example, user_id=783214
Twitter Web options:
cursor: Unclear. I'd assume this removes the selection cursor in Twitter Web. For example, cursor=-1
display_location: The location to display the results (for Twitter Web). For example, display_location=st-view-all-stream
pc: Unclear. I'd assume this is just user-agent checking. For example, pc=true
It doesn't require authentication to hit against. I'm not sure if this is rate-limited, because I can't find any further information at the time of this writing.
While no documentation has been given by Twitter on this API, it's in current use by Twitter Web and Twitter Mobile for iOS, and it otherwise appears to be production-ready. Obviously, no guarantees can be had until Twitter officially releases it.
Good luck!
There's also a thing you may remember since theres no API 1.0 you cannot make requests from javascript, jquery, ajax or client languages to json. You can only make requests just with server languages like PHP to json in API 1.1.
But let's think that you want to make your application more dynamic, if we cannot make request to twitter directly, the solution is that you have to use PHP auth with Twitter and then in your own page (with the response of the php page) make the Javascript, ajax, and you can make it dynamic like API 1.0.
my own application Twitter API

Twitter site-streams

I would like to use the twitter site-streams but I can't find a way to use them. There is no API-docs online and how to access site-streams.
Does someon have an example in php or better c#?
Are there any API-samples or a full API-doc?
Thanks
Matthias
I called oAuth before doing something similar to Shannon Whitley's user streams example. Use the curl commands generated for you at dev.twitter.com to double check your C# generate urls.
The site stream url is buried in the top middle of the doc (/2b/site.json?follow=1,2,3,4,5) # dev.twitter.com
I'd also follow #sitestreams as well to get heads up on site stream restarts.
The API looks to still be in beta, I found this. It's not a lot of detail, but the post was only a few weeks ago so it is something pretty new. It uses the same REST API that all of twitter uses so if you are familiar with that you should be able to use what it gives you.
If you need a tutorial on REST with twitter here is a decent tutorial. It is using basic authentication so I do strongly recommend that you use OAuth instead.

User Login using API

I'm currently trying to create a simple application for my own use (I'm trying to learn iPhone Programming) and I want to know how you create a login page which will log a user in and store/keep them logged in via an API.
I don't know where to begin on storing information/cached info etc.
I want to use the current API that is all in XML from Eveonline here: http://wiki.eve-id.net/APIv2_Page_Index
I can't find any examples online for Xcode to learn/work off, nor can I find any code snippets that would somewhat explain the process.
Any help would be appreciated.
Looking at the API I would use something like NSURLRequest as it is a straight forward HTTP login with authentication by token.
Here is an example