I have some problems in replacing manachat's old algorithm to gather online list in game. Actually I've spotted a code syntax error when a Game Master logs in resolving it into a unnecessary b tag enclosure.
Nothing game-compromising but I have problems understanding python regexp and failed to list names that contains spaces.
Is there another source when online players list can be gathered?
TMWA HTML Online list
Re: TMWA HTML Online list
Sorry, nevermind...
Solved with that code of shame:
Solved with that code of shame:
Code: Select all
#!/usr/bin/env python
from HTMLParser import HTMLParser
import urllib2
import re
class MLStripper(HTMLParser):
def __init__(self):
self.reset()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def get_data(self):
return ''.join(self.fed)
def strip_tags(html):
s = MLStripper()
s.feed(html)
return s.get_data()
#Filter html tags and excape codes
data=re.sub(r'<.*?>|&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});\r\n\t', '', strip_tags(urllib2.urlopen('https://server.themanaworld.org/online.html').read())).splitlines()
newdata = []
for x in data:
newdata.append(x.strip())
print filter(None, newdata)[3:-1]
Re: TMWA HTML Online list
you can also use https://server.themanaworld.org/online-old.txt
Re: TMWA HTML Online list
NOOOOOOOOOO!!!!!!!!!
I've wasted an entire day to fix that...
Thanks for that info Gumi!
If I only had known before...
I've wasted an entire day to fix that...
Thanks for that info Gumi!
If I only had known before...