简体   繁体   中英

No results with python twitter search

I'm using python twitter to do a simple search but I'm not getting any results, even though I get results when performing the results manually. For example, I wrote a simple test script like this:

#! /usr/bin/env python
# coding=utf-8

import twitter
api=twitter.Api()
tweets=api.GetSearch(u'東京大学',per_page=10,page=1)

for t in tweets:
    print t.text

If I search for 東京 (English: Tokyo), then it works, but if I increase this by 2 more characters like 東京大学 (English: Tokyo University) then nothing comes back.

Can someone tell me why? I have no ideas (T_T)

Thanks!

It turns out that by adding lang="ja" within the GetSearch command, I can return more results. I suppose that the default is US English users tweeting in Japanese, which gives far fewer results than Japanese users tweeting in Japanese.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM