#Import urllib to be able to get the contents from the webpages
import urllib
#get the content of the page with the list of all posts
content = urllib.urlopen("http://forum.codecall.net/games/21449-four-word-game.html?mode=threaded").read()
#Create two variables
Index = 0
posts = []
#A while loop to find all posts
while "writeLink(" in (content[Index:]):
#Get the number of the post
Index = content.index("writeLink(",Index)
Number = content[Index + len("writeLink("):content.index(",",Index)]
Index += 1
#Save the post number for later
posts+= [Number]
#Go through all posts
for post in posts:
if "208731" == post: #First post
print "once upon a time",
else:
#Get content of post
content = urllib.urlopen("http://forum.codecall.net/" + post + "-post.html").read()
#Get the startposition of the message
Index = content.index('<div id="post_message_' + post + '">')
#Get the message
message = content[Index + len('<div id="post_message_' + post + '">'):content.index("</div>",Index)]
#Removes the note that the post is posted with CodeCall Mobile(if it is)
message = message.replace('<i>Posted via <a href="http://codecall.mobi" target="_blank">CodeCall Mobile</a></i>',"")
print message,
EDIT:
I have now also created a web version. It's faster and you don't need python installed :D It's located at: http://vswe.codecall.net/FourWord.php
Edited by Vswe, 09 October 2009 - 10:34 AM.


Sign In
Create Account


Back to top









