Jump to content


Photo

Need Help With Gamercard


  • Please log in to reply
20 replies to this topic

#16 Demogorge

Demogorge

    X-S Enthusiast

  • Members
  • 1 posts

Posted 02 May 2008 - 02:07 AM

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('<span class="XbcFLAL">([^<]*)</span>.*?<img class="XbcgcGamertile" height="64" width="64" src="([^"]*)".*?<img src="/xweb/lib/images/gc_repstars_external_([^.]*).gif" />.*?<span class="XbcFLAL"><img alt="Gamerscore" src=".*" /></span><span class="XbcFRAR">(.*)</span>.*?<span class="XbcFLAL">Zone</span><span class="XbcFRAR">(.*)</span>', 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.

#17 personman

personman

    X-S Enthusiast

  • Members
  • 18 posts

Posted 06 May 2008 - 02:51 AM

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('<span class="XbcFLAL">([^<]*)</span>.*?<img class="XbcgcGamertile" height="64" width="64" src="([^"]*)".*?<img src="/xweb/lib/images/gc_repstars_external_([^.]*).gif" />.*?<span class="XbcFLAL"><img alt="Gamerscore" src=".*" /></span><span class="XbcFRAR">(.*)</span>.*?<span class="XbcFLAL">Zone</span><span class="XbcFRAR">(.*)</span>', 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!

#18 NeoTINS

NeoTINS

    X-S Enthusiast

  • Members
  • 2 posts

Posted 06 May 2008 - 10:55 AM

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

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

#19 Jezz_X

Jezz_X

    X-S Knowledgebase

  • Moderator
  • PipPipPipPipPipPipPipPip
  • 4,531 posts
  • Location:Australia
  • Xbox Version:v1.1
  • 360 version:none

Posted 06 May 2008 - 01:55 PM

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

#20 devouringone3

devouringone3

    X-S Enthusiast

  • Members
  • 17 posts
  • Xbox Version:v1.6
  • 360 version:none

Posted 13 January 2009 - 07:33 AM

EDIT:
Oh shit, I got it, yay thanks!!

cause it worked (after not 1 but 2 xbox reboot) actually!!

biggrin.gif

Its kay




Hummmm.... starting from those two files (set_gamercard.py and gamercardupdate.py) I got in the SVN (Jezz), with or without the line "card_data = card_html[8]", and with the new ip of xbox.com (from 65.59.234.166 to 65.59.234.169) (In Kreten's last thread http://forums.xbox-s...owtopic=672727).

My Xbox.com GamerCard isn't showing up still sad.gif.

Anyone? Now that I've pretty much tried all I could find here.

I have rev1096 MC360...

Thanks for helping me

Edited by devouringone3, 13 January 2009 - 07:34 AM.


#21 IAmTheDude360

IAmTheDude360

    X-S Young Member

  • Members
  • Pip
  • 39 posts

Posted 27 January 2009 - 05:59 PM

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!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users