No results with python twitter search

327 Views Asked by At

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!

1

There are 1 best solutions below

0
Tetsuo On BEST ANSWER

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.