Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Twitter API question/issue

Options
  • 13-04-2017 9:54am
    #1
    Registered Users Posts: 745 ✭✭✭


    Hi All,

    I'm hoping someone can shed some light I'm having when trying to use the Twitter API.

    I am using an R script to capture tweets for a particular topic/hashtag.

    When I try the following search parameters;

    searchTwitter("#dublinbikes", n=50), this returns '50 tweets were requested but the API can only return 33'

    searchTwitter("#ryanair", n=50), this returns 50 tweets.

    I don't know why the first search is returning so few Tweets, there appears to be more than 33 tweets for Dublin bike. Is there something else I need to consider when using the API? Any tips or pointers would be much appreciated.

    TIA


Comments

  • Registered Users Posts: 81,223 ✭✭✭✭biko


    The first request is for 50 but there are only 33 mentions, so only 33 were returned.
    Try n=25, n=30 etc to see how that works.

    It's case sensitive - try dublinbikes, Dublinbikes and DublinBikes



    For more troubleshooting, compare to twitter itself with low-count hashtags like https://twitter.com/hashtag/emeraldsweets?src=hash
    Note that twitter itself is not case sensitive.


  • Registered Users Posts: 745 ✭✭✭illdoit2morrow


    biko wrote: »
    The first request is for 50 but there are only 33 mentions, so only 33 were returned.
    Try n=25, n=30 etc to see how that works.

    It's case sensitive - try dublinbikes, Dublinbikes and DublinBikes



    For more troubleshooting, compare to twitter itself with low-count hashtags like https://twitter.com/hashtag/emeraldsweets?src=hash
    Note that twitter itself is not case sensitive.

    Thanks for that. I've done some more reading up on the API, What i've read (https://dev.twitter.com/rest/public/search) says that it only looks at Tweets in the last seven days. I'm guessing the volumes of tweets about Dublin Bikes isn't that great. When i run the same query today i get 3 Tweets, this is with the expanded search parameter 'DublinBikes+Dublinbikes+dublinbikes'.

    This topic might not be suitable for the college work i am hoping to do.

    When i try emeraldsweets in my code, i'm getting zero tweets. When i try it on Twitter i get ten.


Advertisement