Package twitter4j.v1

Interface TrendsResources


public interface TrendsResources
Since:
Twitter4J 2.1.3
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the locations that Twitter has trending topic information for.
    Returns the locations that Twitter has trending topic information for, closest to a specified location.
    The response is an array of "locations" that encode the location's WOEID and some other human-readable information such as a canonical name and country the location belongs in.
    A WOEID is a Yahoo! Where On Earth ID.
    getPlaceTrends(int woeid)
    Returns the top 10 trending topics for a specific WOEID, if trending information is available for it.
    The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Twitter Search, and the Twitter Search URL.
    This information is cached for 5 minutes.
  • Method Details

    • getPlaceTrends

      Trends getPlaceTrends(int woeid) throws TwitterException
      Returns the top 10 trending topics for a specific WOEID, if trending information is available for it.
      The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Twitter Search, and the Twitter Search URL.
      This information is cached for 5 minutes. Requesting more frequently than that will not return any more data, and will count against your rate limit usage.

      This method calls https://api.twitter.com/1.1/trends/place.json
      Parameters:
      woeid - The Yahoo! Where On Earth ID of the location to return trending information for. Global information is available by using 1 as the WOEID.
      Returns:
      trends
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 3.0.2
      See Also:
    • getAvailableTrends

      ResponseList<Location> getAvailableTrends() throws TwitterException
      Returns the locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in.
      This method calls https://api.twitter.com/1.1/trends/available.json
      Returns:
      the locations
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 2.1.1
      See Also:
    • getClosestTrends

      ResponseList<Location> getClosestTrends(GeoLocation location) throws TwitterException
      Returns the locations that Twitter has trending topic information for, closest to a specified location.
      The response is an array of "locations" that encode the location's WOEID and some other human-readable information such as a canonical name and country the location belongs in.
      A WOEID is a Yahoo! Where On Earth ID.
      This method calls https://api.twitter.com/1.1/trends/closest.json
      Parameters:
      location - the available trend locations will be sorted by distance to the lat and long passed in. The sort is nearest to furthest.
      Returns:
      the locations
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 3.0.2
      See Also: