socialtone / socialtone

Main source repository for socialtone
0 stars 2 forks source link

ENH: Trending on twitter #10

Open zowiehi opened 7 years ago

zowiehi commented 7 years ago

Add a list of top trending topics on twitter to trending section

jakereps commented 7 years ago

Sick, tweepy supports this so can just be context on the main page or something.

>>> pp.pprint(api.trends_place(1)[0]['trends'][:5]) # place 1 is "global"
[{'name': 'Liverpool',
  'promoted_content': None,
  'query': 'Liverpool',
  'tweet_volume': 132378,
  'url': 'http://twitter.com/search?q=Liverpool'},
 {'name': '#Broadchurch',
  'promoted_content': None,
  'query': '%23Broadchurch',
  'tweet_volume': None,
  'url': 'http://twitter.com/search?q=%23Broadchurch'},
 {'name': '#UniversityChallenge',
  'promoted_content': None,
  'query': '%23UniversityChallenge',
  'tweet_volume': None,
  'url': 'http://twitter.com/search?q=%23UniversityChallenge'},
 {'name': '#محمد_بن_نايف_امير_القلوب',
  'promoted_content': None,
  'query': '%23%D9%85%D8%AD%D9%85%D8%AF_%D8%A8%D9%86_%D9%86%D8%A7%D9%8A%D9%81_%D8%A7%D9%85%D9%8A%D8%B1_%D8%A7%D9%84%D9%82%D9%84%D9%88%D8%A8',
  'tweet_volume': 17342,
  'url': 'http://twitter.com/search?q=%23%D9%85%D8%AD%D9%85%D8%AF_%D8%A8%D9%86_%D9%86%D8%A7%D9%8A%D9%81_%D8%A7%D9%85%D9%8A%D8%B1_%D8%A7%D9%84%D9%82%D9%84%D9%88%D8%A8'},
 {'name': '#LiderBeşiktaş',
  'promoted_content': None,
  'query': '%23LiderBe%C5%9Fikta%C5%9F',
  'tweet_volume': 44950,
  'url': 'http://twitter.com/search?q=%23LiderBe%C5%9Fikta%C5%9F'}]

image

zowiehi commented 7 years ago

:+1: