|
|||||||
This is a discussion on "How to?" in the Top Mud Sites MUD and RPG Webmasters forum : I've noticed on some sites this: We are currently rank #10 We need 8 votes to to move up a rank. Does anyone know how to do this?... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
New Member
Join Date: Aug 2002
Posts: 3
![]() |
I've noticed on some sites this:
We are currently rank #10 We need 8 votes to to move up a rank. Does anyone know how to do this? |
|
|
|
|
|
#2 |
|
Member
Join Date: Apr 2002
Posts: 126
![]() |
php (see www.php.net)
|
|
|
|
|
|
#3 | |
|
Member
|
Quote:
First, are you using the parser that goes through the content on a webpage (TMS) looking for a specific string in the content (your Mud's name)? And if so, are you using the "class" that needs a unique start and end string to know what to look for? If so, I can't seem to figure out a few things: - Once you find your mud's name, how do you tell it to "back up" to get the rank, and the previous mud's vote number to find out how many votes you need. - If you are using this class and telling it to look for a unique string, does the parsing ignore HTML tags? - How do you look for and store multiple values. I can get it to "grab" the name, but I can't seem to figure out how to grab the name, our ranking, our votes, and the previous muds votes all in one. - Finally, how do you deal with the possibility that your mud could be on any page. IE: main page if ranked 1-20, page 2 if ranked 21-40, etc. Do you just have it look on each page until it finds it? Thanks a ton! |
|
|
|
|
|
|
#4 |
|
Member
Join Date: Jun 2002
Posts: 142
![]() |
Uh well I've been trying to do the same thing with php, for the past 5 months, on and off, and I have been unsuccessful. So I would advise, if you just got the idea to do this, this is what you'll do:
1) Visit this thread 2) Buy some paracetamol 3) Go to php.net and read all their pages 4) Take paracetamol for your headache 5) Try to get various scripts that do web grabbing 6) See 4 Finally 5 months later 1200) Give up It is possible, but I can't see an easy way. Maybe there isn't, or someone kind might have actually been of help? Sometimes it takes an evil mastermind to program supremely hard things, and evil geniuses like them don't usually help. I believe such scripts have been programmed by these people in the past for their MUDs. Notice how they manage to capture the name of the MUD before em too. Diabolically clever. We could always bug Synozeer to death to make a user friendly page just to show the MUD's names and their votes. Or we could offer him 500 bucks or something. Hmm, I'll get my foghorn ready, you supply the chalkboard and I'll get someone to bring along a cat to scrape it. Those secrets will be mine... all miiinneee.... Sssssoonnn, my presssssciousssss.. |
|
|
|
|
|
#5 |
|
Member
Join Date: Nov 2003
Posts: 39
![]() |
Poor Fr0g - not much help so far, eh?
What you are looking for is on various PHP help forums across the 'net - this is a very common question. You are looking for a function called fopen() or file_get_contents(). If it sounds like I'm not 100% sure it's only because I'm trying to plan my approach to this exact same problem, with one sticking point: I'd be surprised if TMS doesn't mind if, every time someone views a page on my site, my server downloads the TMS index - just to grab two numbers for my page ?! I am hopeful that maybe a lesser detailed page exists somewhere on TMS that just lists the top 50 in a very basic format for others to work out their position and that of the prior mud. So what about it, huh? Any hidden URLs on TMS? Without such a page, the painful task for you, mr. webmaster, is to use PHP to grope your way through all of the HTML on the ranking web page of TMS (whichever rank page your mud is listed on, hopefully) -- and grab the rank and votes of your mud and the one listed immediately before it. Good luck! PS: sample PHP thread about parsing a web page |
|
|
|
|
|
#6 |
|
Member
Join Date: Jun 2003
Posts: 125
![]() |
You guys are making this sound sooooooo much harder than it is! Using CURL with preg_split() should make this pretty trivial.
As for whether TMS would mind you reading their page... I expect your website traffic is quite low compared to theirs anyway so I doubt it would be noticable. A simple XML version of the rankings might be nice though. |
|
|
|
|
|
#7 |
|
Member
Join Date: Nov 2003
Posts: 39
![]() |
Well, there are various obstacles that you will need to check:
= Curl support compiled in? = php version requirement for file_get_contents (4.3+, I think)? = Security setting 'allow_url_fopen' set to 1, ie may open files via a URL? Although I'm no expert, I'd agree the task isn't huge once you get the basics working. Using php.net and the examples for file_get_contents, strip_tags and even simple ones like fgets and htmlentities (for when you're testing) should get you across the line. Hope that helps. |
|
|
|
|
|
#8 |
|
New Member
|
perl has so many built in libraries that make parsing webpages a snap (Well perl isn't a snap, but still)
PHP is not ment for command line apps, its been modified for peopel to write apps with, but its not designed that way in mind. Perl is a good scripting language. Or shell script (ksh,bash,sh,csh, tclsh, etc etc etc) works too, with help from curl and such. As for cheating the systerm, don't. |
|
|
|