Commit 1de60f64 authored by 4sakura's avatar 4sakura

implement issue #53 language selection

and add table with country code
parent f47d011e
......@@ -65,6 +65,72 @@ A few simple examples to help you understand the basics:
## Example String
`955511208597184512 2018-01-22 18:43:19 GMT <now> pineapples are the best fruit`
## Language code
**maybe this shold get a Wikipage?**
|Language|code|
|---|:---:|
|arabic|ar|
|amharic|am|
|armenian|hy|
|bangla|bn|
|bulgarian|bg|
|burmese|my|
|central kurdish|ckb|
|chinese|zh|
|danish|da|
|divehi|dv|
|dutch|nl|
|english|en|
|estonian|et|
|finnish|fi|
|french|fr|
|georgian|ka|
|german|de|
|greek|el|
|gujarati|gu|
|haitian creol|ht|
|hebrew|he|
|hindi|hi|
|hungarian|hu|
|icelandic|is|
|indonesian|id|
|italian|it|
|japanese|ja|
|kannada|kn|
|khmer|km|
|korean|ko|
|lao|lo|
|latvian|lv|
|lithuanian|lt|
|malayalam|ml|
|marathi|mr|
|nepali|ne|
|norwegian|no|
|odia|or|
|pashto|ps|
|persian|fa|
|polish|pl|
|portugese|pt|
|punjabi|pa|
|romanian|ro|
|russian|ru|
|spanish|es|
|serbian|sr|
|sindhi|sd|
|sinhala|si|
|slovenian|sl|
|swedish|sv|
|tagalog|tl|
|tamil|ta|
|telugu|te|
|thai|th|
|tibetian|bo|
|turkish|tr|
|urdu|ur|
|uyghur|ug|
|vietnamese|vi|
## Screenshot
<img src="https://i.imgur.com/RKdBrHr.png" />
......
......@@ -79,6 +79,8 @@ async def getUrl(init):
url+= "&lang=en&include_available_features=1&include_entities=1&reset_"
url+= "error_state=false&src=typd&max_position={}&q=".format(init)
if arg.l != None:
url = url.replace("lang=en", "l={0.l}&lang=en".format(arg))
if arg.u != None:
url+= "from%3A{0.u}".format(arg)
if arg.g != None:
......@@ -460,6 +462,7 @@ if __name__ == "__main__":
ap.add_argument("-u", help="User's Tweets you want to scrape.")
ap.add_argument("-s", help="Search for Tweets containing this word or phrase.")
ap.add_argument("-g", help="Search for geocoded tweets.")
ap.add_argument("-l", help="Serch for Tweets in a specific language")
ap.add_argument("-o", help="Save output to a file.")
ap.add_argument("-es", "--elasticsearch", help="Index to Elasticsearch")
ap.add_argument("--year", help="Filter Tweets before specified year.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment