Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Twitter API question/issue

  • 13-04-2017 08:54AM
    #1
    Registered Users, Registered Users 2 Posts: 756 ✭✭✭


    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, Registered Users 2 Posts: 81,060 ✭✭✭✭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, Registered Users 2 Posts: 756 ✭✭✭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