TodayPlus Boards v2

TodayPlus for the Pocket PC Forums => General => Topic started by: MadTxn on January 02, 2004, 09:50:51 AM

Title: Movie Listings
Post by: MadTxn on January 02, 2004, 09:50:51 AM
I wasn't sure were to put this, so mods, feel free to move this as you see fit.

As per the request/suggestion by fishboy, I modified my movie listings script to accept theaters in the URL.  So if someone wants to host it for people, it's now possible.

Usage:

http://someservername/somedirectory/listings_rss.php?theater1=theater1&zip1=zip1&theater2=theater2&zip2=zip2...

So, for instance, for my theaters, I use:

listings_rss.php?theater1=Muvico&zip1=21076&theater2=UA Snowden Square&zip2=21046&theater3=CO Rio 14&zip3=20878&theater4=AMC Hoffmann Center 22&zip4=22314&theater5=AMC Columbia 14&zip5=21044


I only tested it with the theaters I know, so please let me know if you get any weird behavior.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 12:33:38 PM
What do I have to do to change it to receive one theather only? the name of the Theather is Regal Commerce Center 18 zip 08824
Title: Movie Listings
Post by: Eitel on January 02, 2004, 12:41:22 PM
Quote from: joelw135What do I have to do to change it to receive one theather only?

Just call it like this:

http://someservername/somedirectory/listings_rss.php?theater1=Theater Name&zip1=Theater zip
Title: Movie Listings
Post by: MadTxn on January 02, 2004, 12:41:32 PM
Just use one theater name and zip code.


listings_rss.php?theater1=Your theater here&zip1=theater zip here


The script is dynamic so it *should* be able to accept any number of theaters.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 12:42:58 PM
Do I change any thing in the script?
Title: Movie Listings
Post by: MadTxn on January 02, 2004, 01:06:43 PM
Nope.  That's the beauty of it.
Title: Movie Listings
Post by: fishboy on January 02, 2004, 01:19:49 PM
In case anyone is interested, here is my PHP Script to get stock information from Yahoo.  It displays the stock name, current price, and change as one rss entry (i.e. ^DJI 10463.48 +9.56).

The format to use this script is:
http://someservername/somedirectory/YahooStocks-rss.php?symbols=symbol1+symbol2+symbol3...
For example:
http://someservername/somedirectory/YahooStocks-rss.php?symbols=^dji+^ixic+^gspc+aivsx
You can enter as many symbols as you want.  Goto http://finance.yahoo.com to look up symbols for a particular stock.

EDIT:  FYI, the file size is only 936 B (.936 KB), not 936 KB as incorretly reported by the board.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 01:47:10 PM
When I try to get the movie listing nothing comes up. My provider does not allow numeric IP.  When I try it in IE I get this error:
Fatal error: Call to undefined function: file_get_contents() in /home/virtual/site66/fst/home/jwaxman/public_html/listings_rss.php on line 68

And this is the important part of the rss:

listings_rss.php?theater1=Loews New Brunswick&zip1=08824
Title: Movie Listings
Post by: fishboy on January 02, 2004, 01:53:39 PM
joelw135,

I don't know if this is causing your problem, but I noticed that in your address:

listings_rss.php?theater1=Loews New Brunswick&zip2=08824

zip2 should be zip1, the next theater would be theater2=...&zip2=... etc.

Oh, and MadTxn, nice job!  :)
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 01:55:49 PM
I just copied it wrong, it is correct in script., and I changed it in above post.
Title: Movie Listings
Post by: fishboy on January 02, 2004, 02:03:54 PM
FYI.  I tried your parameters using IE with my server and it worked fine for me (although I did get a weird error the first time).  Most likely is a problem with the server that is running the script, not the script itself.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 02:07:21 PM
Ok I got to figure out what the problem is, really want this to work.
Title: Movie Listings
Post by: fishboy on January 02, 2004, 02:11:30 PM
What version of PHP Server is your server running? I am using PHP 4.3.4.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 02:12:47 PM
Really don't know, it is on my sons, which is remote.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 02:13:57 PM
I guess I will have to wait until someone is willing to host it.
Title: Movie Listings
Post by: MadTxn on January 02, 2004, 02:14:23 PM
I just checked the PHP manual, and you need to have version 4.30 or higher for this to work.  Sorry...

You know what?  I'm not sorry.  Upgrade or else. :twisted:
Title: Movie Listings
Post by: fishboy on January 02, 2004, 02:17:23 PM
Well I believe that the to use the function "file_get_contents" requires version 4.3.0 or higher, so you might want to find out what version you have and have your son upgrade the server it is lower than this version.

EDIT:  Looks like MadTxn is a faster gun slinger than I, beat me to the draw.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 03:36:52 PM
My son spoke to the owner of his server and he is unwilling to upgrade or even tell him what version he has.

Is there another command that can replace the get command?
Title: Movie Listings
Post by: MadTxn on January 02, 2004, 03:55:40 PM
Well, changing the command will make the script take longer to run, and will be more memory intensive on the server.  Maybe our fine host would be willing to host the file for a few people.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 03:57:21 PM
That would be nice.
Title: Movie Listings
Post by: MadTxn on January 02, 2004, 04:06:58 PM
Because I'm just a Prime Specimen of Manhood©, and because you've been so nice about it, I edited the script just for you.  Enjoy.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 04:08:24 PM
You are indeed a scholar and a Gentleman.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 04:21:43 PM
Works great, and fast. Thanks again.
Title: Movie Listings
Post by: MadTxn on January 02, 2004, 05:07:44 PM
Not a problem.  Also, for future reference, if you place a file with the following in it:


<?php
phpinfo
();
?>



it will tell you the PHP version, along with a buttload of other stuff.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 05:12:06 PM
If at a later date I want to add another theater, all I would do is add the &theater2=Name&zip2=zip Is that correct?
Title: Movie Listings
Post by: MadTxn on January 02, 2004, 09:25:32 PM
You are correct.
Title: Movie Listings
Post by: joelw135 on January 02, 2004, 09:46:38 PM
Ran into a problem. the script would take so long to download the information, that it would not sync TodayPlus. If I did it via wi-fi it would work, but not in the cradle. I removed that rss feed and it would sync fine. Back to the drawing board. Got to find another host.

Anyone know a free PHP host in the USA?


Used your script and found out that the server is running 4.2.2 PHP.
Title: Movie Listings
Post by: joelw135 on January 04, 2004, 11:32:13 AM
I think I have found a temporary fix for the movie times refresh problem. What I did was move the movie RSS to the first on the list. This way it gets the hard to sync info first.  I have tried it a few times, and seems to work. I will see later when the net is filled with users.

P.S. It takes around 2 minutes to full refresh. It used to take aprox 30 seconds.
Title: Movie Listings
Post by: LawofA on January 04, 2004, 11:42:32 AM
Quote from: joelw135If at a later date I want to add another theater, all I would do is add the &theater2=Name&zip2=zip Is that correct?

Hi Guys:

Where will this line go in the script? Secondly, I am not getting any details with the downloads. Is there anything I an not doing right?

Thanks.

LawofA
Title: Movie Listings
Post by: joelw135 on January 04, 2004, 11:47:37 AM
That line is part of the line you use in the config file to call the server for information.
The example below is what the line would look without a server selected.
You need a host to carry the script, that the line below calls.

http://server name/server directory/listings_rss.php?theater=Regal commerce Center 18&zip1=08824

And of course you must change the theater and the zip to what you want.
Title: Movie Listings
Post by: MadTxn on January 04, 2004, 11:51:33 AM
Quote from: LawofA
...Secondly, I am not getting any details with the downloads. Is there anything I an not doing right?

What do you mean "details"?  All you should be getting is a listing of movie titles, then clicking on them (depending on your skin), should show a list of theaters with times.  Are you not getting that?  If not, make sure that the theater name is exactly as it shows up in Yahoo, along with the theater's zip code.

joelw135 - I'm pretty sure the script shouldn't take that long.  Even running from my home PC with a 256K upload that's pretty much fully utilized, it doesn't take that long.
Title: Movie Listings
Post by: joelw135 on January 04, 2004, 11:54:57 AM
All I get is the first list of movies , I never get a list of theaters. I know I entered the correct rss address. Only the movies in one theater show.
Title: Movie Listings
Post by: joelw135 on January 04, 2004, 11:58:50 AM
I uploaded the special script you wrote for the older PHP. I even tried your theaters on my sons server. If I didn't make that the first rss download I couldn't refresh weather. I think it timed out or something.
Title: Movie Listings
Post by: MadTxn on January 04, 2004, 06:07:41 PM
I don't know what to tell you about the timeout, but as for the details, you should get the list of movies, as you see, then you should be able to tap the movie name, and get something like the below picture, just imagine for your skin.

(http://home.comcast.net/~madtxn/todayplus/rss.gif)
Title: Movie Listings
Post by: joelw135 on January 04, 2004, 06:52:31 PM
Found the problem, I reloaded the script to the server, and it now works.
Title: Movie Listings
Post by: SacredCow on January 04, 2004, 11:42:14 PM
Quote from: MadTxnWell, changing the command will make the script take longer to run, and will be more memory intensive on the server.  Maybe our fine host would be willing to host the file for a few people.

I will speak for him/her/them and say they've done alot already. :)

I just reqistered movierss.com and moviesrss.com and have them setup on our primary server. Need to wait for the dns to update and we're qood.

Oh and I have to install the script ;)

-SC
Title: Movie Listings
Post by: srs on January 05, 2004, 12:03:50 AM
you guys need to be very careful hosting anything that screen scrapes yahoo pages.  Yahoo really dislikes this and they actively look for and take steps against any script / program etc that scrapes their pages.

that said, anything relatively small scale should "fly under the radar" (although I wouldn't be suprised if they caught it...).
Title: Movie Listings
Post by: Eitel on January 05, 2004, 12:30:24 AM
That's what I haven't offered to host them.  A couple of people using them shouldn't be a problem, but you got a lot of them running the same file, it really get's noticed.

When I put in place the RSS for this site, the bandwidth almost doubled.
Title: Movie Listings
Post by: srs on January 05, 2004, 12:47:49 AM
you'd think with yahoo being such a large site, they would hardly notice or care about the odd script here or there, but, suprisingly, from what I've read elsewhere, this seems not to be the case.

afaik they haven't taken any really onerous actions, other than perhaps sending a letter / changing the page code so that the scraping no longer works.
Title: Movie Listings
Post by: LawofA on January 05, 2004, 06:02:41 AM
Quote from: joelw135All I get is the first list of movies , I never get a list of theaters. I know I entered the correct rss address. Only the movies in one theater show.

Hi MadTxn:
I got confused. What I meant by details were actually list of theaters, which I still need help on.

Hi joelw135:

I still cannot get movies in more than one theater to show. Could you please explain to me how to do that?


Thanks.

LawofA
Title: Movie Listings
Post by: joelw135 on January 05, 2004, 07:53:54 AM
After theater1=xxxxx&zip1=xxxxx&theater2=xxxxx&zip2=xxxxx&theater3=xxxxx&zip3=xxxxx

Just follow what I did above put the name of the theater as listed on Yahoo then the zip code you use. It can be all the same zip as you did in Yahoo.

You don't see the other theaters until you click on a movie title.
Title: Movie Listings
Post by: fishboy on January 05, 2004, 09:33:21 AM
Quote from: srsyou guys need to be very careful hosting anything that screen scrapes yahoo pages. Yahoo really dislikes this and they actively look for and take steps against any script / program etc that scrapes their pages.

Thanks for the warning.  I don't think the stocks feed script should cause much of a fuss because it is utilizing their already available web page to retrieve a comma delimited list of data for a stock (which can easily be accessed by IE).  This script is not actually a page scraper as it only loops thru a list of stocks, calls this page, and reformats the results.  

Got my fingers crossed that Yahoo looks at this as acceptable.  :)
Title: Movie Listings
Post by: LawofA on January 05, 2004, 12:58:51 PM
Quote from: joelw135After theater1=xxxxx&zip1=xxxxx&theater2=xxxxx&zip2=xxxxx&theater3=xxxxx&zip3=xxxxx

Just follow what I did above put the name of the theater as listed on Yahoo then the zip code you use. It can be all the same zip as you did in Yahoo.

You don't see the other theaters until you click on a movie title.

Hi joelw135:
I still don't get it. Where and what line in the script is this added. If possible, could you PM me your script? I will appreciate it.

Thanks.

LawofA
Title: Movie Listings
Post by: MadTxn on January 05, 2004, 01:12:46 PM
You don't change the script.  That's at the end of the URL you use to view it.  So in your config, for this RSS entry, you would have:

http://server name/server directory/listings_rss.php?theater1=xxxxx&zip1=xxxxx&theater2=xxxxx&zip2=xxxxx&theater3=xxxxx&zip3=xxxxx
Title: Movie Listings
Post by: LawofA on January 05, 2004, 02:14:51 PM
Quote from: MadTxnYou don't change the script.  That's at the end of the URL you use to view it.  So in your config, for this RSS entry, you would have:

http://server name/server directory/listings_rss.php?theater1=xxxxx&zip1=xxxxx&theater2=xxxxx&zip2=xxxxx&theater3=xxxxx&zip3=xxxxx

Thanks MadTxn. I will try it tonight.

LawofA
Title: Movie Listings
Post by: SacredCow on January 06, 2004, 02:42:41 AM
well I'm still up for hosting the scripts... atleast until told  otherwise.

eitel & madtxn - any idea on the kind of bandwidth usage we're looking at?

also perhaps a few things can be done...

A)  mod the script to cache so it's not making so many calls?

B) find a source interested in letting us qet these feeds?

Also I might be ok hosting the stock feed as well.

-SC
Title: Movie Listings
Post by: MadTxn on January 06, 2004, 10:00:12 AM
I have no idea on the bandwidth... but my file opened in Opera and saved is 9.19kb.  It shouldn't be downloaded more than once or twice a day.

The caching is a good idea, except it would be different for every person.  I'll work on it...
Title: Movie Listings
Post by: joelw135 on January 06, 2004, 01:00:07 PM
I have mine set to refresh in 180 minutes which is the max allowed in the config, I wonder if you edit the registry you can set it to once a day. I just changed the  registry, so that it does it every 8 hours. I will see if that works.
Title: Movie Listings
Post by: SacredCow on January 07, 2004, 01:21:52 AM
Quote from: MadTxnI have no idea on the bandwidth... but my file opened in Opera and saved is 9.19kb.  It shouldn't be downloaded more than once or twice a day.

The caching is a good idea, except it would be different for every person.  I'll work on it...

The thinking behind the cache was that theaters most likely don't change times often? Maybe every couple of days?

So it would hopefully cut BW and cut hits to Yahoo... atleast from the same people using the RSS and refreshing?

Now I just need to get the script up.... tomorrow (Wed.)

-SC
Title: Movie Listings
Post by: joelw135 on January 07, 2004, 07:42:27 AM
That would be great.
Title: Movie Listings
Post by: bubba on January 09, 2004, 02:05:09 AM
Hi All ---

I get the following error (on my web page) when attempting to load the rss page
QuoteXML Parsing Error: mismatched tag. Expected: </description>.
Location: http://myserver.com/listings_rss.php?theater1=harkinsfashionsquare&zip1=85251
Line Number 5, Column 66:  <description>Movie Listings from Yahoo! for ovies - Showtimes</title>

Any ideas?

Thanks for any and all replies.

Cheers.

BD
Title: Movie Listings
Post by: joelw135 on January 09, 2004, 08:18:28 AM
Are you sure the name of the theater is one word, I don't think that is correct. Put spaces between the words, and try that. It should be this.
Harkins Fashion Square 7
Title: Movie Listings
Post by: bubba on January 09, 2004, 10:16:57 AM
Quote from: joelw135Are you sure the name of the theater is one word, I don't think that is correct. Put spaces between the words, and try that. It should be this.
Harkins Fashion Square 7

That's it...thanks.

I was going to the movie section of Yahoo and entering my zipcode and then using the exact name of the theatre as it appeared on the site. In this instance, clearly that is wrong.

Appreciate the help.
Title: It's up
Post by: SacredCow on January 09, 2004, 11:29:38 PM
Well, got the script on the server, sorry for the delay.

http://www.moviesrss.com/listings_rss.php

You can dump the www and it'll work fine.

I'll probably put up a more generic domain for other feed needs.

Does the stock script need a home?

-SC
Title: Movie Listings
Post by: joelw135 on January 09, 2004, 11:52:39 PM
Thanks a lot, works great, the stock feed does need a home as far as I know. Nice when it is on a fast server.
Title: Movie Listings
Post by: Scotty on January 09, 2004, 11:55:00 PM
Thanks, MdTxn for the php script; and SacredCow, for hosting it.

Works like a charm !!

Scotty.
Title: Movie Listings
Post by: bubba on January 10, 2004, 01:52:21 AM
Hi All ---

For movies that are currently playing at more than 2 theaters, I need to be able to scroll down to see the remaining times, however there isn't a scroll bar. Any idea how to have a scroll bar appear when neeed?

Thanks.
Title: Movie Listings
Post by: joelw135 on January 10, 2004, 09:03:00 AM
Yea, I had the same problem, I will wait to see if any one has any ideas. I guess the region size has to be changed.
Title: Movie Listings
Post by: SacredCow on January 10, 2004, 05:59:47 PM
Hey MadTxn - what are you using to get the flyout menu?

What skin?

Thanks!
-SC

Quote from: MadTxnI don't know what to tell you about the timeout, but as for the details, you should get the list of movies, as you see, then you should be able to tap the movie name, and get something like the below picture, just imagine for your skin.

(http://home.comcast.net/~madtxn/todayplus/rss.gif)
Title: Movie Listings
Post by: MadTxn on January 11, 2004, 04:05:42 PM
The skin is my own, which is unfinished.  I mainly have some graphics work left.  As for the floating region, if you check out this (http://www.dark-mojo.com/todayplus/viewtopic.php?p=5880#5880) thread, there are some helpful tips.
Title: Movie Listings
Post by: SacredCow on January 11, 2004, 05:56:48 PM
Thanks :)