Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
---------

Version 3.2
===========

What's Changed
--------------

* :py:func:`twitter.models.Trend`'s `volume` attribute has been renamed `tweet_volume` in line with Twitter's naming convention. This change should allow users to access the number of tweets being tweeted for a given Trend.

Version 3.1
==========

Expand Down
2 changes: 1 addition & 1 deletion testdata/models/models_trend.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"#ChangeAConsonantSpoilAMovie","url":"http:\\/\\/twitter.com\\/search?q=%23ChangeAConsonantSpoilAMovie","promoted_content":null,"query":"%23ChangeAConsonantSpoilAMovie","tweet_volume":null}
{"name":"#ChangeAConsonantSpoilAMovie","url":"http:\\/\\/twitter.com\\/search?q=%23ChangeAConsonantSpoilAMovie","promoted_content":null,"query":"%23ChangeAConsonantSpoilAMovie","tweet_volume":104403}
2 changes: 2 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def test_trend(self):
self.fail(e)
self.assertTrue(trend.AsJsonString())
self.assertTrue(trend.AsDict())
self.assertEqual(trend.tweet_volume, 104403)
self.assertEqual(trend.volume, trend.tweet_volume)

def test_url(self):
url = twitter.Url.NewFromJsonDict(self.URL_SAMPLE_JSON)
Expand Down
6 changes: 5 additions & 1 deletion twitter/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self, **kwargs):
'query': None,
'timestamp': None,
'url': None,
'volume': None,
'tweet_volume': None,
}

for (param, default) in self.param_defaults.items():
Expand All @@ -220,6 +220,10 @@ def __repr__(self):
self.timestamp,
self.url)

@property
def volume(self):
return self.tweet_volume


class Hashtag(TwitterModel):

Expand Down