Possible to code this program?

Status
Not open for further replies.
I'm a complete beginner, and I found a project that interests me. Before I go, I wanted to know if something like this was even feasible. Any input you guys have is appreciated.

I would like to take the list of movies available on-demand from my cable provider, and look up the IMDB rating for those movies, then present me with the list, which I can then sort and see what I haven't watched yet but might be worth seeing. Thoughts?

On demand list: http://uverse.com/uverse/movie_list
 

krimhorn

Ars Legatus Legionis
39,865
Doable? Yeah, though you're not going to get there with IMDB directly (as it doesn't provide a general search API). You'll also have to manually scrape the DOM of your cable provider's movie list.

For looking up the details you've got a couple of decent/good API options. I, personally, use TheMovieDB with Plex and really like their results. Their API is solid enough for Plex to never have trouble finding a particular movie (I haven't, however, programmed against their API myself). TheMovieDB's rating is sourced from internal votes, however, from what I can tell.

The Open Movie Database also has an API and that one purports to provide the IMDB rating at least in an example result.
 

minnmass

Ars Tribunus Militum
2,087
Subscriptor
Selenium, possibly with PhantomJS may be useful for the "manually scrape the DOM of your cable provider's movie list" part.

I use Selenium at work to test the eComm platform we produce. It's basically some glue between the code you'll write and a browser (it works relatively well with Firefox, PhanotmJS, Chrome, and IE); the advantage is that you can leave the DOM parsing to a browser that already knows how to handle the potentially-broken HTML that your cable provider will produce. It can also let you log in, click the "next" button, etc.. The disadvantage is that it requires a full browser to load and for the full page to load ("warts and all").

A very quick glance at http://uverse.com/uverse/movie_list suggests that the built-in selectors Selenium has will be sufficient to scrape the data you want.

PhantomJS is a headless browser - it doesn't display anything while it's running, but it still goes through all the steps. It has less overhead than, say, Firefox. In my experience, it works quite well until it dies a horrible death and stops responding (that said, it's been about a year since my last experience, so it may have improved). If it works, the resulting application can run a bit faster (if for no other reason than that it starts up faster than Firefox); but, it's harder to watch what's going on while you're debugging problems.
 
Would be helpful to know the language you hope to use, and you don't mention if you need the result web based or not... Will this be a local file/page? Or do you need it uploaded somewhere?


With Java, jsoup library does decently with parsing pages. Can easily dump the data to a file...

If you want that web based, can make that file a simple html file you write as you go (assuming you know/will learn basic HTML)


Just remember to be nice with the web page his or api calls, throw in a sleep timer as a safety net while your learning so you don't accident spam their web server with 20 requests in a second :)... a second is my general recommendation as a minimum unless you see they permit differently
 

Drizzt321

Ars Legatus Legionis
34,922
Subscriptor++
[url=http:/civis/viewtopic.php?p=29181501#p29181501:1yrcnakt said:
Myntyn[/url]":1yrcnakt]Would be helpful to know the language you hope to use, and you don't mention if you need the result web based or not... Will this be a local file/page? Or do you need it uploaded somewhere?


With Java, jsoup library does decently with parsing pages. Can easily dump the data to a file...

If you want that web based, can make that file a simple html file you write as you go (assuming you know/will learn basic HTML)


Just remember to be nice with the web page his or api calls, throw in a sleep timer as a safety net while your learning so you don't accident spam their web server with 20 requests in a second :)... a second is my general recommendation as a minimum unless you see they permit differently

Unfortunately, as great as jsoup is, it won't work on a JS rendered page since you need to get the JS to execute first. Thus, for me, HtmlUnit.
 
[url=http:/civis/viewtopic.php?p=29183731#p29183731:16rjjyhp said:
Drizzt321[/url]":16rjjyhp]
[url=http:/civis/viewtopic.php?p=29181501#p29181501:16rjjyhp said:
Myntyn[/url]":16rjjyhp]Would be helpful to know the language you hope to use, and you don't mention if you need the result web based or not... Will this be a local file/page? Or do you need it uploaded somewhere?


With Java, jsoup library does decently with parsing pages. Can easily dump the data to a file...

If you want that web based, can make that file a simple html file you write as you go (assuming you know/will learn basic HTML)


Just remember to be nice with the web page his or api calls, throw in a sleep timer as a safety net while your learning so you don't accident spam their web server with 20 requests in a second :)... a second is my general recommendation as a minimum unless you see they permit differently

Unfortunately, as great as jsoup is, it won't work on a JS rendered page since you need to get the JS to execute first. Thus, for me, HtmlUnit.

The JS has to get data from somewhere. As long as you can reverse engineer the authentication and web service calls JS rendered pages are often easier to work with than trying to parse HTML.
 

Drizzt321

Ars Legatus Legionis
34,922
Subscriptor++
[url=http:/civis/viewtopic.php?p=29187379#p29187379:snvq4a2s said:
Ravensroke[/url]":snvq4a2s]
[url=http:/civis/viewtopic.php?p=29183731#p29183731:snvq4a2s said:
Drizzt321[/url]":snvq4a2s]
[url=http:/civis/viewtopic.php?p=29181501#p29181501:snvq4a2s said:
Myntyn[/url]":snvq4a2s]Would be helpful to know the language you hope to use, and you don't mention if you need the result web based or not... Will this be a local file/page? Or do you need it uploaded somewhere?


With Java, jsoup library does decently with parsing pages. Can easily dump the data to a file...

If you want that web based, can make that file a simple html file you write as you go (assuming you know/will learn basic HTML)


Just remember to be nice with the web page his or api calls, throw in a sleep timer as a safety net while your learning so you don't accident spam their web server with 20 requests in a second :)... a second is my general recommendation as a minimum unless you see they permit differently

Unfortunately, as great as jsoup is, it won't work on a JS rendered page since you need to get the JS to execute first. Thus, for me, HtmlUnit.

The JS has to get data from somewhere. As long as you can reverse engineer the authentication and web service calls JS rendered pages are often easier to work with than trying to parse HTML.

I've done this a couple of times, and it can work well. But not always. And typically it takes quite a bit of time using Firebug or similar to figure out exactly what it's doing, and then possibly being able to replicate it well enough in code.
 

CanSpice

Ars Tribunus Angusticlavius
7,147
[url=http:/civis/viewtopic.php?p=29183731#p29183731:3ngpzyz2 said:
Drizzt321[/url]":3ngpzyz2]
[url=http:/civis/viewtopic.php?p=29181501#p29181501:3ngpzyz2 said:
Myntyn[/url]":3ngpzyz2]Would be helpful to know the language you hope to use, and you don't mention if you need the result web based or not... Will this be a local file/page? Or do you need it uploaded somewhere?


With Java, jsoup library does decently with parsing pages. Can easily dump the data to a file...

If you want that web based, can make that file a simple html file you write as you go (assuming you know/will learn basic HTML)


Just remember to be nice with the web page his or api calls, throw in a sleep timer as a safety net while your learning so you don't accident spam their web server with 20 requests in a second :)... a second is my general recommendation as a minimum unless you see they permit differently

Unfortunately, as great as jsoup is, it won't work on a JS rendered page since you need to get the JS to execute first. Thus, for me, HtmlUnit.

This page doesn't look like a JS rendered page. It looks like it's all built up with JSP on the server. There aren't any ajax calls being made (at least, none that Chrome devtools picked up).
 

Drizzt321

Ars Legatus Legionis
34,922
Subscriptor++
[url=http:/civis/viewtopic.php?p=29193991#p29193991:297nbmtn said:
CanSpice[/url]":297nbmtn]
[url=http:/civis/viewtopic.php?p=29183731#p29183731:297nbmtn said:
Drizzt321[/url]":297nbmtn]
[url=http:/civis/viewtopic.php?p=29181501#p29181501:297nbmtn said:
Myntyn[/url]":297nbmtn]Would be helpful to know the language you hope to use, and you don't mention if you need the result web based or not... Will this be a local file/page? Or do you need it uploaded somewhere?


With Java, jsoup library does decently with parsing pages. Can easily dump the data to a file...

If you want that web based, can make that file a simple html file you write as you go (assuming you know/will learn basic HTML)


Just remember to be nice with the web page his or api calls, throw in a sleep timer as a safety net while your learning so you don't accident spam their web server with 20 requests in a second :)... a second is my general recommendation as a minimum unless you see they permit differently

Unfortunately, as great as jsoup is, it won't work on a JS rendered page since you need to get the JS to execute first. Thus, for me, HtmlUnit.

This page doesn't look like a JS rendered page. It looks like it's all built up with JSP on the server. There aren't any ajax calls being made (at least, none that Chrome devtools picked up).

Sure, for this one page that might be the case, but I've had to scrape some which have been generated and/or fetched data via AJAX.
 
Status
Not open for further replies.