<commit_before>"""Usage:
  spacebot (-c CHANNEL) (-t TOKEN)
  spacebot (-h | --help)

  Options:
  -c CHANNEL --channel=CHANNEL    The Slack channel/group ID.
  -t TOKEN --token TOKEN          Your Slack API token
  -h --help                       Show this screen.
"""
import json
import urllib2
import datetime
import re

from docopt import docopt
from slacker import Slacker
from bs4 import BeautifulSoup


if __name__ == '__main__':
    args = docopt(__doc__)
    token = args['--token']
    channel = args['--channel']

    response = urllib2.urlopen('http://apod.nasa.gov/apod/astropix.html')
    html = response.read()
    soup = BeautifulSoup(html)
    title = soup.b.string
    img_url = 'http://apod.nasa.gov/%s' % str(soup.img['src'])
    text = re.findall('Explanation:(.*?)Tomorrow', soup.get_text(), re.DOTALL | re.MULTILINE)[0]
    text = str(text.replace('\n', ' ').rstrip().lstrip())
    text = re.sub("\s\s+", " ", text)  # removes double spaces<commit_msg>Switched to unicode strings from ascii.<commit_after>"""Usage:
  spacebot (-c CHANNEL) (-t TOKEN)
  spacebot (-h | --help)

  Options:
  -c CHANNEL --channel=CHANNEL    The Slack channel/group ID.
  -t TOKEN --token TOKEN          Your Slack API token
  -h --help                       Show this screen.
"""
import json
import urllib2
import datetime
import re

from docopt import docopt
from slacker import Slacker
from bs4 import BeautifulSoup


if __name__ == '__main__':
    args = docopt(__doc__)
    token = args['--token']
    channel = args['--channel']

    response = urllib2.urlopen('http://apod.nasa.gov/apod/astropix.html')
    html = response.read()
    soup = BeautifulSoup(html)
    title = soup.b.string
    img_url = 'http://apod.nasa.gov/%s' % str(soup.img['src'])
    text = re.findall('Explanation:(.*?)Tomorrow', soup.get_text(), re.DOTALL | re.MULTILINE)[0]
    text = text.replace('\n', ' ').rstrip().lstrip()
    text = re.sub("\s\s+", " ", text)  # removes double spaces
{'fraction_non_alphanumeric': 0.15575849822425164, 'fraction_numerical': 0.004058853373921867, 'mean_word_length': 2.904950495049505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7208325', 'n_tokens_mistral': 696, 'n_tokens_neox': 671, 'n_words': 172}