In [9]:
%run "~/Documents/Stockholm/KTH/Courses/BigData/Project/Big-Data-Final/DataGathering/data_gathering.py"
print("done")


done

In [2]:
token = get_access_token("X2gxqgESTyTPg8xzkssZn39pA", "wSnehKghoRjtusDfGoA2KLg1J3VfMbtraXz1eriQPxwwLG1Iso")
print(token)


AAAAAAAAAAAAAAAAAAAAAPY62gAAAAAAUGA8nJomXvOni%2FXpNNuvZhtgAMg%3DvtffumSGrVK3snSkAsWWIlyxNuL30DsaSM3yygdZOvZaYlqCc7

In [15]:
results = get_search_results("trump", 20, "recent", token)


Pulling 20 tweets...
20/20 tweets pulled

In [13]:
filtered = []
convert_retweets(results)
#strip_urls(results)
for i in range(0, min(5, len(results)):
    t = results[i]
    print("{} | {}".format(t["full_text"], t["truncated"]))


READ. THIS. STORY. 

Y'all like to give Ivanka passes. But she's a liar just like her Dad.

QUICK HIGHLIGHT THREAD.

https://t.co/1v34YzEjQh | False
Trump's going to get bruises from patting himself on the back so hard. https://t.co/5Y0VkfNGM4 | False
Trump tweets this just hours before he flies to Vegas to meet with the families of victims. https://t.co/e4BTbDAtX6 | False
Breaking News Today 10/4/17, US Navy Makes Tragic Announcement, President Trump,TOP USA NEWS https://t.co/u3h5MwbBfM | False
🎶 And that's how you get Trump 🎶 https://t.co/nHnM7rPBwT | False

In [14]:
tweets_to_csv(results, "/Users/carlo/Documents/Stockholm/KTH/Courses/BigData/Project/out/test.csv")
print("done")


done

In [ ]: