<commit_before>#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
imdb.py - Willie Movie Information Module
Copyright © 2012, <NAME>, <<EMAIL>>
Licensed under the Eiffel Forum License 2.

This module relies on imdbapi.com
"""
import json
import web

def imdb(willie, trigger):
    """
    Returns some information about a movie, like Title, Year, Rating, Genre and IMDB Link.
    """
    if not trigger.group(2):
        return
    word=trigger.group(2).rstrip()
    word=word.replace(" ", "+")
    uri="http://www.imdbapi.com/?t="+word
    u = web.get_urllib_object(uri, 30)
    data = json.load(u) #data is a Dict containing all the information we need
    u.close()
    if data['Response'] == 'False':
        if 'Error' in data:
            message = '[MOVIE] %s' % data['Error']
        else:
            willie.debug('movie', 'Got an error from the imdb api, search phrase was %s' % word, 'warning')
            willie.debug('movie', str(data), 'warning')
            message = '[MOVIE] Got an error from the IMDB api'
    else:
        message = '[MOVIE] Title: ' +data['Title']+ \
                  ' | Year: ' +data['Year']+ \
                  ' | Rating: ' +data['imdbRating']+ \
                  ' | Genre: ' +data['Genre']+ \
                  ' | IMDB Link: http://imdb.com/title/' + data['imdbID']
    willie.say(message)

imdb.commands = ['movie', 'imdb']
imdb.example = '.movie Movie Title'

if __name__ == '__main__':
    print __doc__.strip()<commit_msg>[movie] Remove all refrences to imdb in the code<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
imdb.py - Willie Movie Information Module
Copyright © 2012, <NAME>, <<EMAIL>>
Licensed under the Eiffel Forum License 2.

This module relies on imdbapi.com
"""
import json
import web

def movie(willie, trigger):
    """
    Returns some information about a movie, like Title, Year, Rating, Genre and IMDB Link.
    """
    if not trigger.group(2):
        return
    word=trigger.group(2).rstrip()
    word=word.replace(" ", "+")
    uri="http://www.imdbapi.com/?t="+word
    u = web.get_urllib_object(uri, 30)
    data = json.load(u) #data is a Dict containing all the information we need
    u.close()
    if data['Response'] == 'False':
        if 'Error' in data:
            message = '[MOVIE] %s' % data['Error']
        else:
            willie.debug('movie', 'Got an error from the imdb api, search phrase was %s' % word, 'warning')
            willie.debug('movie', str(data), 'warning')
            message = '[MOVIE] Got an error from imdbapi'
    else:
        message = '[MOVIE] Title: ' +data['Title']+ \
                  ' | Year: ' +data['Year']+ \
                  ' | Rating: ' +data['imdbRating']+ \
                  ' | Genre: ' +data['Genre']+ \
                  ' | IMDB Link: http://imdb.com/title/' + data['imdbID']
    willie.say(message)

movie.commands = ['movie', 'imdb']
movie.example = '.movie Movie Title'

if __name__ == '__main__':
    print __doc__.strip()
{'fraction_non_alphanumeric': 0.1598925092374874, 'fraction_numerical': 0.006718172657037286, 'mean_word_length': 2.4749124854142357, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '867572', 'n_tokens_mistral': 1001, 'n_tokens_neox': 952, 'n_words': 277}