Translated into python. Tested it and noticed that the Gold is now formatted different on Gaia, also the item pattern has a few slashes out of place. My version, pretty much the same as Alex's:
Also, anyone knows if there still are multiple pages in inventories?
Code:#!/usr/bin/env python #TekTek Class #Author: Riddle #E-mail: NONE #Find out how much your account is worth. ##TEMP############ import Gaiaonline# ################## import General import HTTP import urllib.parse class TekTek: def __init__(self, Gaia): """TekTek Class: Make_Profile(): Makes a text file with important information Price_Inv(): Returns the price of the inventory """ self.g = General.General() self.HTTP = Gaia.Get_HTTP() self.User = Gaia.Get_Username() self.Pass = Gaia.Get_Password() self.Email = None self.U_ID = None #Gold formatting on HTML pages of Gaia has changed self.Gold_Start = "<span id=\"gold_amt\">" self.Gold_End = "</span>" #Item Pattern for inventory page self.Item_Patt = "<img style=\"cursor: hand;\" title=\"(.*?)\" hidden_src=" def Price_Inv(self): HTML = self.HTTP.GET("http://www.gaiaonline.com/profile/inventory.php?type=all") Gold = (self.g.GetBetween(HTML,self.Gold_Start,self.Gold_End)).replace(",","") items = self.Parse_Inv(HTML) post = "environment=0&txt=" post += urllib.parse.quote("xtitle=\"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Trans") for item in items: post += urllib.parse.quote("xtitle=\"" + item + "\" hidden_src=\"http://") post += urllib.parse.quote("Gold: " + Gold + "\t\t\t ") URL = "http://www.tektek.org/gaia/worth.php" self.HTTP.Set_Referer("http://www.tektek.org/gaia/worth.php") HTML = self.HTTP.POST(URL,post) Make_Profile(HTML) def Parse_Inv(self,HTML): """Returns a list of items in inventory page""" r = self.g.Find_All(self.Item_Patt,HTML) return r def Make_Profile(self,HTML): """ Save all important data to a text file. - User - User ID - Pass - Email - Worth - List of items with their worth """ #Finish it later... pass
Results 1 to 4 of 4
Thread: Ooh, ah!
Threaded View
- 16 May. 2010 09:01pm #3