Find Twitterpublictimeline to access Twitterpublictimeline, first of all you must find it.
In other words, you must first be found will be used to access Twitter on publicfeed endpoint. (To obtain information about TwitterAPI, see references). The most common and most easy to use endpoint is publictimeline, you can access the endpoint from http://twitter.com/statuses/public_timeline.rss. Used for the endpoint is located at FriendFeedpublictimeline Google code library (later reference section contains a link). FriendFeedAPI receive simple GET and POST requests. To simplify the problem, use the public endpoints, which can be found at http://friendfeed.com/api/feed/public?format=xml. XML will be used later. Visit Twitterpublictimeline now have Twitterpublictimeline endpoint, then, how to access it? can in the browser, enter the following address, but the better practice is to use the curl command line: curlhttp://twitter.com/statuses/public_timeline.rss now, you may have to construct an endpoint from the results or in the way that you see is the output of the RSS format. Read the API documentation you can see, there are other formats. By setting the file extension .xml or .json instead, you can change the output format. By using grep command, you can filter the results only gets the desired parameters: curlhttp://twitter.com/statuses/public_timeline.xml | grep'text ' view output:
you need is between the tags. However, if you want to remove the tag around a tweet, you can use the sed command. (This article does not discuss the details of the sed command, to learn about this wonderful tool for more information, see references). Curlhttp://twitter.com/statuses/public_timeline.xml |
<\ text="">sed-ne'///gp ' now, remove the progress bar, because it is a timeline adds unnecessary information, and then add the-s switch: curl-shttp://twitter.com/statuses/public_timeline.xml |
<\ text="">\> sed-ne'///gp ' find FriendFeedpublictimeline you already use cURL to get used to the publictimeline Twitter. \> Now you want to do the same thing FriendFeed. Here, for the endpoint is FriendFeedAPI publicfeed http://friendfeed.com/api/feed/public?format=xml. However, tracking for FriendFeed's publicfeed like a needle in a haystack, so there will be scope to your friend's feed. Again, see the API documentation. This requires some search, but you are looking for is the homefeed, its location is http://friendfeed.com/api/feed/home. Of course, you must verify that the feed, and you must be signed, so that the feed/home know who you are. Fortunately, cURL with validation options, which makes this process very simple: username: password however, FriendFeed and does not use a user name and password. Instead, the site needs a nickname and remote authentication key. Therefore, you must enter by http://friendfeed.com/account/api FriendFeed site and get them. After entering the URL, you can login and get a nickname and a remote key. Use the nickname and remote key to issue the following command: curl-u "nickname: key" http://friendfeed.com/api/feed/home which nickname: key is a nickname and a key. The command to JavaScriptObjectNotation (JSON) format returns the current FriendFeed. To get the XML, you must add a format parameter. Since this is a get request, therefore you can add it to the end of the URL: curl-u "nickname: key" http://friendfeed.com/api/feed/home?format=xml is good, isn't it?
No comments:
Post a Comment