Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bbelderbos/own_movie_site
https://github.com/bbelderbos/own_movie_site
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/bbelderbos/own_movie_site
- Owner: bbelderbos
- Created: 2016-02-23T00:37:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-02-23T21:16:00.000Z (over 8 years ago)
- Last Synced: 2023-03-23T02:12:21.362Z (over 1 year ago)
- Language: HTML
- Size: 66.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Your own movie site in less than one minute with OMDb API and Python
* copy and paste top 250 movies from [imdb](http://www.imdb.com/chart/top) and put in file called inimdb-top-rated.txt file (or take another movie list source, but the better the source/spelling/accuracy, the better the result)
```html
$ head imdb-top-rated.txt
1. The Shawshank Redemption (1994) 9.2
2. The Godfather (1972) 9.2
3. The Godfather: Part II (1974) 9.0
4. The Dark Knight (2008) 8.9
5. Pulp Fiction (1994) 8.9
```
* normalize the data to title,year:```html
$ grep -v "^ *$" imdb-top-rated.txt |perl -pe 's/ *\d+\.\s+(.*)\s+.*\((\d+)\).*/\1,\2/g' > movielist.txt$ wc -l movielist.txt
250 movielist.txt$ head movielist.txt
The Shawshank Redemption,1994
The Godfather,1972
The Godfather: Part II,1974
The Dark Knight,2008
Pulp Fiction,1994
Schindler's List,1993
12 Angry Men,1957
The Lord of the Rings: The Return of the King,2003
The Good, the Bad and the Ugly,1966
Fight Club,1999
```html
* run the python script that queries [omdb](http://omdbapi.com/) for movie info returning a nice html page, 2% not found, but a movie html page in less than 1 minute :)```html
$ time python your_moviedb.py movielist.txt
ERR2: cannot find movie: Old Boy (year: 2003)
ERR2: cannot find movie: Érase una vez en América (year: 1984)
ERR2: cannot find movie: M (year: 1931)
ERR2: cannot find movie: Nader y Simin, una separación (year: 2011)
ERR2: cannot find movie: Relatos salvajes (year: 2014)
Done, 245 processed, created static html movie page: topmovies.htmlreal 0m13.348s
user 0m0.755s
sys 0m0.420s
```* see example output by opening topmovies.html output file in the browser