Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD and RPG Webmasters (http://www.topmudsites.com/forums/forumdisplay.php?f=13)
-   -   How to? (http://www.topmudsites.com/forums/showthread.php?t=860)

Fr0g 08-07-2002 11:13 AM

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?

nass 10-26-2002 06:53 PM

php (see )

Lanthum 10-31-2002 12:40 AM


Davairus 05-29-2003 06:10 AM

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..

gth 11-11-2003 06:24 AM

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:

Kylotan 11-11-2003 09:29 AM

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.

gth 11-30-2003 07:27 AM

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 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.

halkeye 12-16-2003 07:29 AM

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.


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

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022