This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'We are Content Providers' | |
import json | |
from twython import Twython, TwythonError, TwythonStreamer | |
import pymongo | |
import re | |
from time import sleep, gmtime, strftime | |
import random | |
import numpy as np | |
from botcontrol import My_Bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.newwolverhampton.aggregate([{$unwind: "$Appeals"},{$project: {_id: 0, BAReference: 1, Postcode: 1, EffectDate: 1, TotalArea: 1, BillingAuthority: 1, RateableValue: 1, Address: 1, Description: 1, Appeal_Reference: "$Appeals.ReferenceNo", Appeal_Applicant: "$Appeals.Applicant", Appeal_Agent: "$Appeals.Agent", Grounds: "$Appeals.Grounds_for_Appeal", Appeal_Start: "$Appeals.Start_Date", Appeal_End: "$Appeals.End_Date", Appeal_Settlement: "$Appeals.Settlement"}},{$out: "newwolvesappeals"}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymongo | |
from time import gmtime, strftime, sleep | |
connection = pymongo.Connection('localhost', 27017) #connect to database host | |
db = connection.ratesdb #connect to rates database | |
results = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def appeal_scrape(soup, appeal_no): | |
appeals_array = [] | |
top_dict = {} | |
appeal_cursor = 1 | |
rating_cursor = 1 | |
#print "looking for appeals" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from twython import Twython, TwythonError, TwythonStreamer | |
import pymongo | |
# Setup Authentification Settings | |
APP_KEY = 'YOURKEY' | |
APP_SECRET = 'YOURSECRET' | |
OAUTH_TOKEN = 'YOURTOKEN' | |
OAUTH_TOKEN_SECRET = 'YOURTOKENSECRET' |