xboxscene.org forums

Pages: 1 [2]

Author Topic: Need Help With Gamercard  (Read 1255 times)

Demogorge

  • Archived User
  • Newbie
  • *
  • Posts: 1
Need Help With Gamercard
« Reply #15 on: May 01, 2008, 07:43:00 PM »

D'oh!

I just spent the last hour resolving this problem (after downloading rev 1096 from Blackbolt's site)...

Though the small fix works, you can do slightly better. Here is my code, which goes in the GetGTNFO function of set_gamercard.py and gamercardupdate.py:

CODE

    wsock = urllib.urlopen(str(card_url))
    card_html = wsock.read()
    wsock.close()
    nfo = re.search('([^<]*).*?.*?Gamerscore(.*).*?Zone(.*)', card_html, re.IGNORECASE).groups()
    return nfo


You'll never have to change a 7 to an 8 again, since this parses the whole page, but if the structure of the gamercard html changes too much then you'll of course have to rewrite the regex. This expression can handle some minor changes, which is better than before.
Logged

personman

  • Archived User
  • Newbie
  • *
  • Posts: 2
Need Help With Gamercard
« Reply #16 on: May 05, 2008, 07:51:00 PM »

QUOTE(Demogorge @ May 2 2008, 02:43 AM) View Post

D'oh!

I just spent the last hour resolving this problem (after downloading rev 1096 from Blackbolt's site)...

Though the small fix works, you can do slightly better. Here is my code, which goes in the GetGTNFO function of set_gamercard.py and gamercardupdate.py:

CODE

    wsock = urllib.urlopen(str(card_url))
    card_html = wsock.read()
    wsock.close()
    nfo = re.search('([^<]*).*?.*?Gamerscore(.*).*?Zone(.*)', card_html, re.IGNORECASE).groups()
    return nfo


You'll never have to change a 7 to an 8 again, since this parses the whole page, but if the structure of the gamercard html changes too much then you'll of course have to rewrite the regex. This expression can handle some minor changes, which is better than before.



Thanks for this, it works for me!
Logged

NeoTINS

  • Archived User
  • Newbie
  • *
  • Posts: 2
Need Help With Gamercard
« Reply #17 on: May 06, 2008, 03:55:00 AM »

YES!!! I've been patiently waiting for a fix for this problem. biggrin.gif

Thank you, Demogorge, THANK YOU!! beerchug.gif
Logged

Jezz_X

  • Archived User
  • Hero Member
  • *
  • Posts: 2893
Need Help With Gamercard
« Reply #18 on: May 06, 2008, 06:55:00 AM »

QUOTE(NeoTINS @ May 6 2008, 08:31 PM) View Post

YES!!! I've been patiently waiting for a fix for this problem. biggrin.gif

Thank you, Demogorge, THANK YOU!! beerchug.gif

couldn't of been waiting too hard it was fixed Mar 27 2008, 09:56 AM in the SVN if you look back a page
Logged

IAmTheDude360

  • Archived User
  • Newbie
  • *
  • Posts: 23
Need Help With Gamercard
« Reply #19 on: January 27, 2009, 09:59:00 AM »

Me too. Mines not been updating since NXE, am assuming the htmls changed a lot with the introduction of avators. Tis a shame as it was one of the 'bragging features' which I loved to show my friends!
Logged
Pages: 1 [2]