https://github.com/motdotla/goodfilms-graph
Get film data from Goodfil.ms.
https://github.com/motdotla/goodfilms-graph
Last synced: 3 months ago
JSON representation
Get film data from Goodfil.ms.
- Host: GitHub
- URL: https://github.com/motdotla/goodfilms-graph
- Owner: motdotla
- Created: 2013-07-31T17:57:14.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-08-02T01:13:09.000Z (about 12 years ago)
- Last Synced: 2024-10-14T11:01:44.979Z (about 1 year ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# goodfilms-graph
Choose a random film from [goodfil.ms](http://goodfil.ms) excellent [graph](http:/goodfil.ms/graph/graph.json). Also, crudely tells you if you can find the film on netflix, hulu, amazon, or itunes. Gives you a direct url.
## Usage
```javascript
var goodfilmsGraph = require('goodfilms-graph');
goodfilmsGraph.random({}, function(err, film) {
if (err) { return console.error(err); }
console.log(film);
});
```Optionally, pass a filter argument of `{x: 4, y: 4}`. This will only select from films that have a rating higher than or equal to a 4 on both the x axis and y axis. The x axis is Goodfil.ms star rating and the y axis is Goodfil.ms 'rewatchable' rating.
```javascript
var goodfilmsGraph = require('goodfilms-graph');
goodfilmsGraph.random({x: 4, y: 4}, function(err, film) {
if (err) { return console.error(err); }
console.log(film);
});
```The outputted film object generally looks like this.
```json
{
image: 'http://cf2.imgobject.com/t/p/w154/hC9u7vlma8c4h0ibX2KmfOksn2F.jpg',
title: 'What\'s Eating Gilbert Grape',
year: 1993,
id: 60302,
x: 4.237359687181692,
y: 3.1091803168081897,
radius: 5.484796933490655,
url: '/film/60302-what-s-eating-gilbert-grape',
netflix_url: 'http://goodfil.ms/film/60302-what-s-eating-gilbert-grape/netflix_url',
itunes_url: null,
amazon_url: null,
hulu_url: null
}
```## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request## Running tests
```bash
npm test
```