Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD and RPG Webmasters
Click here to Register

Reply
 
Thread Tools
Old 08-07-2002, 11:13 AM   #1
Fr0g
New Member
 
Join Date: Aug 2002
Posts: 3
Fr0g is on a distinguished road
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?
Fr0g is offline   Reply With Quote
Old 10-26-2002, 06:53 PM   #2
nass
Member
 
nass's Avatar
 
Join Date: Apr 2002
Posts: 128
nass is on a distinguished road
php (see www.php.net)
nass is offline   Reply With Quote
Old 10-31-2002, 12:40 AM   #3
Lanthum
Member
 
Lanthum's Avatar
 
Join Date: Oct 2002
Location: Suburbs of Chicago
Posts: 138
Lanthum is on a distinguished road
Send a message via MSN to Lanthum
Quote:
Originally Posted by (nass @ Oct. 26 2002,5:53 pm)
php (see www.php.net)
I was interested in this as well so I took your suggestion and went to php.net and started going through a bunch of the tutorials.  I am still a little confused.  I was wondering if you might help out with some pointers/suggestions/ideas etc.

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!  
Lanthum is offline   Reply With Quote
Old 05-29-2003, 06:10 AM   #4
Davairus
Member
 
Join Date: Jun 2002
Posts: 157
Davairus is an unknown quantity at this point
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..
Davairus is offline   Reply With Quote
Old 11-11-2003, 06:24 AM   #5
gth
Member
 
Join Date: Nov 2003
Posts: 50
gth is on a distinguished road
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
gth is offline   Reply With Quote
Old 11-11-2003, 09:29 AM   #6
Kylotan
Member
 
Join Date: Jun 2003
Location: Nottingham, UK
Home MUD: Abattoir (Smaug)
Home MUD: ex-Jellybean (Smaug)
Home MUD: ex-Dark Chambers (Merc)
Posts: 174
Kylotan is on a distinguished road
Send a message via ICQ to Kylotan Send a message via AIM to Kylotan Send a message via MSN to Kylotan Send a message via Yahoo to Kylotan
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.
Kylotan is offline   Reply With Quote
Old 11-30-2003, 07:27 AM   #7
gth
Member
 
Join Date: Nov 2003
Posts: 50
gth is on a distinguished road
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.
gth is offline   Reply With Quote
Old 12-16-2003, 07:29 AM   #8
halkeye
New Member
 
halkeye's Avatar
 
Join Date: Jan 2003
Name: Gavin
Location: Vancouver, Canada
Posts: 12
halkeye is on a distinguished road
Send a message via ICQ to halkeye Send a message via AIM to halkeye Send a message via MSN to halkeye
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.
halkeye is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 05:01 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014