Skip to content

Instantly share code, notes, and snippets.

View andrewwxy's full-sized avatar

Andrew andrewwxy

View GitHub Profile
#!/usr/bin/env python
"""
Save stock ticker data from Yahoo! Finance to sqlite.
"""
import datetime as d
import sqlite3
import pandas.io.data as web
import pandas.io.sql as sql
from TwitterSearch import *
import csv
def get_tweets(query, max = 2000):
# takes a search term (query) and a max number of tweets to find
# gets content from twitter and writes it to a csv bearing the name of your query
i = 0
search = query