<commit_before><commit_msg>add incomplete twitter bot script<commit_after>import json
import requests
import re
import random
from bs4 import BeautifulSoup
from TwitterAPI import TwitterAPI

def post_tweet():
	consumer_key = 'WZlNC5ScS3fGKjnPFnWcyZnFA'
	consumer_secret	= '<KEY>'
	access_token = '<KEY>'
	access_secret = '<KEY>'

	api = TwitterAPI(consumer_key, consumer_secret, access_token, access_secret)
	#post = api.request('statuses/update', {'status':'Post Post'})
	#return post.status_code



# BITLY API 
# KEY - <KEY>
# generic access token = <PASSWORD>



headlines_url = 'http://www.bbc.co.uk/news/'
# Use THE SUN news comments.
comments_url = ''

page = requests.get(headlines_url)
soup = BeautifulSoup(page.content)

stories = soup.find_all('a', class_='story')

story = random.choice(stories)
story = story.text.replace('\n', '')
story = re.sub('^\d*:? *', '', story).strip()
story = re.sub('Watch*\d*:?\d*$', '', story)
story = re.sub(' *-* *\d* *Secs* *', '', story)

print(story)
{'fraction_non_alphanumeric': 0.1675025075225677, 'fraction_numerical': 0.003009027081243731, 'mean_word_length': 5.3164556962025316, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6008038', 'n_tokens_mistral': 368, 'n_tokens_neox': 352, 'n_words': 80}