diff --git a/.gitignore b/.gitignore index 5053c0b..534898b 100644 --- a/.gitignore +++ b/.gitignore @@ -88,7 +88,7 @@ env.bak/ venv.bak/ # mkdocs documentation -/site +docs/site # mypy .mypy_cache/ diff --git a/README.rst b/README.rst index 9398704..4b7516b 100644 --- a/README.rst +++ b/README.rst @@ -105,12 +105,18 @@ Now covers these features: - Blocks - Mutes +- Usage + - Tweets + +- Trends + - Spaces - Spaces lookup - Search Spaces -- Compliance - - Batch compliance +- Direct Messages + - Direct Messages lookup + - Manage Direct Messages - Lists - List lookup @@ -120,12 +126,8 @@ Now covers these features: - List follows - Pinned Lists -- Direct Messages - - Direct Messages lookup - - Manage Direct Messages - -- Usage - - Tweets +- Compliance + - Batch compliance - Media Upload - Media Simple upload diff --git a/docs/docs/usage/trends/trends.md b/docs/docs/usage/trends/trends.md new file mode 100644 index 0000000..fbd425e --- /dev/null +++ b/docs/docs/usage/trends/trends.md @@ -0,0 +1,13 @@ +The Trends lookup endpoint allow developers to get the Trends for a location, specified using the where-on-earth id (WOEID). + +**Note:** WOEID is a legacy identifier created by Yahoo and has been deprecated. X API uses the numeric value to identify town and country trend locations. +Reference our legacy [blog post](https://blog.twitter.com/engineering/en_us/a/2010/woeids-in-twitters-trends.html), or [archived data](https://archive.org/details/geoplanet_data_7.10.0.zip0.) + +### Get trends + +Get the trends for a location + +```python +api.get_trends_by_woeid(woeid=1) +# Response(data=[Trend(trend_name='#QuietOnSet', tweet_count=14060), Trend(trend_name='King Charles', tweet_count=42315), Trend(trend_name='Drake Bell', tweet_count=1234)]) +``` diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 64164a6..171c160 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -56,6 +56,8 @@ nav: - Spaces: - Spaces Lookup: usage/spaces/spaces-lookup.md - Search Spaces: usage/spaces/search.md + - Trends: + - Trends: usage/trends/trends.md - Lists: - List lookup: usage/lists/list-lookup.md - Manage Lists: usage/lists/manage-lists.md