Toxic Chili 2 Posted April 26, 2012 Report Share Posted April 26, 2012 Ok this is probably really simple and I am doing something completely wrong. Basically I need to scrape the last part of the url off each of the games from this page http://www.mochimedia.com/games/ For example a game url might be http://www.mochimedia.com/games/play/forest-buddy I need to scape the text 'forest-buddy' and put it in a list, I need to do this for each game on the page, them move onto the next page. And so on. When I try the scrape I either get nothing or I just get the first part of the url without the rest of the details. Some help would be much appreciated. Quote Link to post Share on other sites
magoo 31 Posted April 26, 2012 Report Share Posted April 26, 2012 Is this what you are after?? set(#urls, $scrape attribute(<class="fullLink">, "href"), "Global")set(#urls, $replace(#urls, "http://www.mochimedia.com/games/", $nothing), "Global")set(#urls, $replace(#urls, "-", " "), "Global")clear list(%url_text)add list to list(%url_text, $list from text(#urls, $new line), "Delete", "Global") 1 Quote Link to post Share on other sites
Toxic Chili 2 Posted April 26, 2012 Author Report Share Posted April 26, 2012 Is this what you are after?? Pretty close, yes, I need to leave the hyphen in, so removed that from the code, otherwise perfect :-) Thank you very much :-) Quote Link to post Share on other sites
Toxic Chili 2 Posted April 26, 2012 Author Report Share Posted April 26, 2012 Added functionality to go from page to page now, next step to download and upload games to my arcade site :-) Quote Link to post Share on other sites
Toxic Chili 2 Posted April 30, 2012 Author Report Share Posted April 30, 2012 Managed to get my bot fully working now :-) Basically it can either get a list and download various games from mochimedia or check which games aren't hosted on my site and download them. After this the games need to be uploaded and uncompressed (which I have created a small php file to do. Then settings for each uploaded game changed to point to correct place. Only thing that isn't automated is the upload, but then its just a case of dragging and dropping in an ftp program (might change this to be automated later). Games need to be hosted to earn revenue from them, but the process of manually checking, downloading/uploading and changing settings takes a stupid amount of time. Pleased its working, hopefully will save me loads of time and help the site earn some revenue :-) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.