Skip to content

Commit

Permalink
test(trends): 📝 add docs for trends
Browse files Browse the repository at this point in the history
  • Loading branch information
MerleLiuKun committed Mar 18, 2024
1 parent 5c031ec commit d3908ad
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ env.bak/
venv.bak/

# mkdocs documentation
/site
docs/site

# mypy
.mypy_cache/
Expand Down
18 changes: 10 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions docs/docs/usage/trends/trends.md
Original file line number Diff line number Diff line change
@@ -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)])
```
2 changes: 2 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d3908ad

Please sign in to comment.