labine50 Posted January 5, 2008 Share Posted January 5, 2008 I'm not what you may call "good" with PHP, so I thought I should probably ask about this. I'm trying to put together a list of everybody who plays this game called "Urban Dead". The member ID system is pretty simple; everybody gets the next number that was available when they join. (So, if you joined, and the last person who joined got 1000, you would get 1001.) The basic idea is that it would record the ID number and the name, then add it to a page with all of the number on it. This is what I've been doing manually so far, but I'm starting to get carpal tunnel syndrome from pressing Ctrl, V, and C. I was wondering, would it be possible to make a script where you just enter two numbers, (Ex- 1 and 1000) and then it would go through every ID between those two numbers and records the data to the document, or sends it via email to me? (The data, of course, being the ID number and the stuff between <span class="ptt"> and </span>, which is the name of the person) It sounds bloody complicated, but I think complicated coding is better than going through all ~1 100 000 profiles. Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/ Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 So the members are not stored in a Database? Is this your site or someone elses? Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431500 Share on other sites More sharing options...
papaface Posted January 6, 2008 Share Posted January 6, 2008 Yes that is possible and not that difficult actually Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431512 Share on other sites More sharing options...
acidglitter Posted January 6, 2008 Share Posted January 6, 2008 It sounds like something you could do with a simple mysql query (i'm just guessing its mysql you're saving it to) Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431545 Share on other sites More sharing options...
labine50 Posted January 6, 2008 Author Share Posted January 6, 2008 No, I'm not the guy who owns the website. It's nice to know that it is possible, though. (I assume it still is even though it's now clear I don't own the website) I'll see if I can get something to work now... Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431557 Share on other sites More sharing options...
cooldude832 Posted January 6, 2008 Share Posted January 6, 2008 can u show us a page with the list your copying? Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431558 Share on other sites More sharing options...
labine50 Posted January 6, 2008 Author Share Posted January 6, 2008 Should have clarified this, too- There is no list. A link to a profile looks like this- http://www.urbandead.com/profile.cgi?id=1000 Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431582 Share on other sites More sharing options...
Ken2k7 Posted January 6, 2008 Share Posted January 6, 2008 Oh so data is stored via database. This is easy. Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431697 Share on other sites More sharing options...
sasa Posted January 6, 2008 Share Posted January 6, 2008 try <form method="POST"> Start:<input type="text" name="start" /><br /> End:<input type="text" name="end" /><br /> <input type="submit" name="submit" value="submit" /> </form> <?php if ($_POST['submit']){ echo '<table border="3"><tr><td>ID</td><td>NAME</td></tr>'; for ($i = $_POST['start']; $i <= $_POST['end']; $i++) { $file = 'http://www.urbandead.com/profile.cgi?id='.$i; $a = file_get_contents($file); preg_match('/<span class="ptt">(.*)<\/span>/',$a,$b); echo "<tr><td>$i</td><td>{$b[1]}</td></tr>\n"; } echo '</table>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-431751 Share on other sites More sharing options...
labine50 Posted January 9, 2008 Author Share Posted January 9, 2008 Oh, wow, thanks! You are *officially* my hero. Quote Link to comment https://forums.phpfreaks.com/topic/84676-solved-is-this-possible/#findComment-434183 Share on other sites More sharing options...
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.