• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Anyone know the process of obtaining Tweets via API in real time?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Anyone know the process of obtaining Tweets via API in real time?

    I have requirement for a piece of software to read realtime Tweets from a selection of Twitter accounts, and process the text of the Tweet.

    Is this possible? If so how and is there a subscription cost?

    It would also be useful to obtain all the historical tweets from these accounts for analysis.

    TIA

    DP

    #2
    https://dev.twitter.com/rest/referen.../user_timeline

    That will get the last 3200 tweets from an account.

    (FWIW, I Googled "read tweets API" and there are all sorts of results)
    Best Forum Advisor 2014
    Work in the public sector? You can read my FAQ here
    Click here to get 15% off your first year's IPSE membership

    Comment


      #3
      You could use the streaming APIs: https://dev.twitter.com/streaming/overview

      I knocked together a quick bit of Python (took maybe an hour or so, using an existing Twitter API library) the other year to grab the public stream on New Year's Eve for an hour or so around midnight in each of Central Europe, the UK, and the East Coast of the USA. Over a total of something like three-and-a-half hours, I collected just under 16GB of tweets in JSON format - IIRC each tweet is around 5K, in JSON, so I got around 3 million tweets. (That would only be a small proportion of the actual tweets sent then, as they charge for access to the complete stream, known as the firehose.) That was running on an EC2 micro instance.

      But for a few specified Twitter accounts the amount of data will of course be considerably less, and per-account streams have the full feed. Just find the best open source Twitter library with streaming API support for your platform, and you're in business.

      Comment


        #4
        Oh, and you can't get the historical tweets via any API that I'm aware of. It's possible Twitter offer a paid service for that.

        The controller of an account can request a complete archive of the account via the Settings pages in the Twitter web client. So if these are accounts that you, or whoever wants this, actually own then it's possible.

        Once requested, it usually takes about five or ten minutes for the archive to be put together as a ZIP file; when it's ready, they email a download link to the address associated with that account in its settings. The unpacked archive contains all tweets in source files for each month, named for the year and month, which define JavaScript array literals, each array containing object literals for each tweet - so a bit like JSON, but actual JS. It also has a nifty browser interface, accessed by loading the index.html at the root of the archive's directory tree in a browser using the file: protocol, which not only allows you to browse around by month and year, but also supports a very effective full text search.

        But if you don't own the account, the only way to get that would be to ask the owner to get it and send you a copy.

        Comment


          #5
          Every time I see something like this I get reminded of a Project B (not a Plan B as wouldn't be monitised) I had an idea for that never got round to doing anything with
          Originally posted by Stevie Wonder Boy
          I can't see any way to do it can you please advise?

          I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

          Comment


            #6
            Another Twitter question.

            Is there a Twitter browser plugin or Twitter client that has txt-to-speech (speech synthesis enabled) so that received tweets can be read outloud by the software as they come in without human intervention?

            TIA

            If not, will have to develop one for plan b needs.

            Comment


              #7
              The Social Radio will read your Tweets to you. You can even add background music to it.
              England's greatest sailor since Nelson lost the armada.

              Comment


                #8
                Originally posted by Uncle Albert View Post
                The Social Radio will read your Tweets to you. You can even add background music to it.
                Perfect thanks!

                Comment


                  #9
                  Twisten - Listen to Twitter might be better as I think it has less user intervention.
                  England's greatest sailor since Nelson lost the armada.

                  Comment

                  Working...
                  X