Hi, i'm pretty new to the topic of programming. I was wondering if the following task is possible to achieve. I'm a tv show enthusiast. The main resource is http://www.tvrage.com. Pretty much all shows are listed there including classification, e.g. documentary, reality, scripted etc. On http://www.tvrage.com/all.php all shows are listed alphabetically. They are hyperlinked. When you follow the links you receive brief information about the show. Show Classification: Documentary Show Genre: Family Show Status: New Series Network: Channel 4 (GB) Runtime: 60 Minutes Country: United Kingdom Premiered In: 2006 Episode Order: 3 Code (markup): I'm interested in 2 fields, classification and Country. I have that crazy idea i could program a script which goes to http://www.tvrage.com/all.php. Then follows all those links one after another, stripping the before mentioned fields and writing the information in defined files. Coutry US + Classification Scripted = USSCRIPTED.txt Country US + Docu = USDOCU.txt Those ideas just came to my mind. Honestly i have no idea how to implement all of that and how many lines of code such a script would have. Maybe some of you experienced scripters/programmers could give me a hint if it's possible or not. Thanks in advance. Greetings n00b77
This is possible. A way to do this is with php. You will need to scrape the site. If you look for webfetching tutorials at Hotscript you will get the idea how to do this. http://hotscripts.com/PHP/Tips_and_Tutorials/Web_Fetching/index.html It's basicly the same idea as getting the weatherforcast or stockprices. You will need to build an extra loop for the first page and then walk thru every page and put the info in a databse. Good luck
Hi Edynas, thx a lot for your reply. I checked a lot of tuturials after your posting. But probably because of my beginner status i can't get into those scripts. I got pounding headaches now. I don't know if these are normal symptoms. Maybe this is askin too much, but could you give me some further hints? Thanks a lot in advance. Greetings n00b77
Wau, i cant believe you just said that. So much kindness, so much warmth. You wanna marry me? No honestly. Very nice you wanna walk the extra mile. Lookin forward. Greetings GermanKraut77
Hi, i ruminated a bit over the script. If possible - dont know if im being greedy - you could implement the following. 1. go to http://www.tvrage.com/all.php 2. follow the first link 3. check the following fields: Show Classification: Show Status: Country: 4. put fetched values in RAM 5. make combinations and write in files Classification Documentary Animation Scripted Game Show Reality Variety Status Cancelled/Ended New Series Returning Series Country United States United Kingdom combinations and drop in corresponding files 1.Current Shows in the US USDOCUCURRUS.txt (Documentary|New Series or Returning Series|United States) USANIMATIONCURRUS.txt (Animation|New Series or Returning Series|United States) USSCRIPTEDCURRUS.txt (Scripted|New Series or Returning Series|United States) USGAMESHOWCURRUS.txt USREALITYCURRUS.txt USVARIETYCURRUS.txt (Variety|New Series or Returning Series|United States) 2. Non-Current Shows in the US USDOCUNONCURRUS.txt (Documentary|Cancelled/Ended|United States) USANIMATIONNONCURRUS.txt (Animation|Cancelled/Ended|United States) USSCRIPTEDNONCURRUS.txt (Scripted|Cancelled/Ended|United States) USGAMESHOWNONCURRUS.txt USREALITYNONCURRUS.txt USVARIETYNONCURRUS.txt (Variety|Cancelled/Ended|United States) 3.Current Shows in the UK USDOCUCURRUK.txt (Documentary|New Series or Returning Series|United Kingdom) USANIMATIONCURRUK.txt (Animation|New Series or Returning Series|United Kingdom) USSCRIPTEDCURRUK.txt (Scripted|New Series or Returning Series|United Kingdom) USGAMESHOWCURRUK.txt USREALITYCURRUK.txt USVARIETYCURRUK.txt (Variety|New Series or Returning Series|United Kingdom) 4. Non-Current Shows in the UK USDOCUNONCURRUK.txt (Documentary|Cancelled/Ended|United Kingdom) USANIMATIONNONCURRUK.txt (Animation|Cancelled/Ended|United Kingdom) USSCRIPTEDNONCURRUK.txt (Scripted|Cancelled/Ended|United Kingdom) USGAMESHOWNONCURRUK.txt USREALITYNONCURRUK.txt USVARIETYNONCURRUK.txt (Variety|Cancelled/Ended|United Kingdom) New Series and Returning Series = Current ! Those combinations are the ones i need. All other variations should go into trash. Greetings n00b77
I am working on the script but I don't know if it will be as much as you like but I am sure there are ppl here that will help you futher. BTW Make sure you have permission of tvrage to do this as they might not like it someone minning their site. What I have now is the first part to get the showinfo but when I just tested it isn't working yet. But I think you will get the idea and maybe this will help you a bit futher. I will work on it as I need something similar for myself (other site but same idea) <?php // $filename = "http://www.tvrage.com/shows/$showid"; // Location of the show $start = "<b>Show Information</b>"; // Start Grabbing Code $stop = "<b>Cast</b>"; // Stop Grabbing Code // Get contents of the specified URL and writes it into a string $fd = fopen( $filename, "r" ); $contents = fread( $fd, 50000 ); fclose( $fd ); // Isolates desired section. if(eregi("$start(.*)$stop", $contents, $printing)) { $substring=$printing[1]; // while is added as there are multiple instances of the </table> string & eregi // searches to include the most that matches, not the next. while(eregi("(.*)$stop", $substring, $printing)) { $substring=$printing[1]; }; //put some splittingpoints in the data to get the desired stuff $printing[1] = eregi_replace( "<td width=\'150\' valign=\'top\'>", "splhere", $printing[1] ); $printing[1] = eregi_replace( "</td>", "> splhere", $printing[1] ); $printing[1] = strip_tags($printing[1]); $pat = "splhere"; $datachunks = split($pat, $printing[1]); $a = 1; $b = 2; $c = 3; $i = 1; //get the parts Show Classification Show Status and Country echo "$printing[1]"; //just for testing perpose to see which variable is which chunk } else { // } ?> PHP:
Good morning, sorry for late reply. No time yesterday. Thanks a lot for your script. Seems nice. Since my nick perfectly describes my scripting knowledge you can prolly anticipate how much catching up i have to do. Basically all your lines i have to dig in and wander through tutorials. But it's kinda fun. Feel free to enhance your script. Greetings n00b77
Hi, today i thought about that wonderful script again. Too bad i dont have the knowledge to make one. Programming is a whole new world for me. Too bad i have such a high demand for my first script. Don't really know how to start. Which programs to install? etc Also i would like to add the tvrage field "Premiered In:" to the fetchin process. In addition to my other posting: Interesting Fields to fetch: Show Classification: Show Status: Premiered In: Country: combinations and drop in corresponding files 1.Current Shows in the US USDOCUCURRUS.txt (Documentary|New Series or Returning Series|Year Premiered|United States) USANIMATIONCURRUS.txt (Animation|New Series or Returning Series|Year Premiered|United States) USSCRIPTEDCURRUS.txt (Scripted|New Series or Returning Series|Year Premiered|United States) USGAMESHOWCURRUS.txt USREALITYCURRUS.txt USVARIETYCURRUS.txt (Variety|New Series or Returning Series|Year Premiered|United States) 2. Non-Current Shows in the US USDOCUNONCURRUS.txt (Documentary|Cancelled/Ended|Year Premiered|United States) USANIMATIONNONCURRUS.txt (Animation|Cancelled/Ended|Year Premiered|United States) USSCRIPTEDNONCURRUS.txt (Scripted|Cancelled/Ended|Year Premiered|United States) USGAMESHOWNONCURRUS.txt USREALITYNONCURRUS.txt USVARIETYNONCURRUS.txt (Variety|Cancelled/Ended|Year Premiered|United States) 3.Current Shows in the UK USDOCUCURRUK.txt (Documentary|New Series or Returning Series|Year Premiered|United Kingdom) USANIMATIONCURRUK.txt (Animation|New Series or Returning Series|Year Premiered|United Kingdom) USSCRIPTEDCURRUK.txt (Scripted|New Series or Returning Series|Year Premiered|United Kingdom) USGAMESHOWCURRUK.txt USREALITYCURRUK.txt USVARIETYCURRUK.txt (Variety|New Series or Returning Series|Year Premiered|United Kingdom) 4. Non-Current Shows in the UK USDOCUNONCURRUK.txt (Documentary|Cancelled/Ended|Year Premiered|United Kingdom) USANIMATIONNONCURRUK.txt (Animation|Cancelled/Ended|Year Premiered|United Kingdom) USSCRIPTEDNONCURRUK.txt (Scripted|Cancelled/Ended|Year Premiered|United Kingdom) USGAMESHOWNONCURRUK.txt USREALITYNONCURRUK.txt USVARIETYNONCURRUK.txt (Variety|Cancelled/Ended|Year Premiered|United Kingdom) New Series and Returning Series = Current ! I mean it would be nice to have it stored in exel file. So i can sort colums. So i can check e.g. what docus are aired in the us. Well just wonderin if it's doeable. Greetings n00b77