Created
July 30, 2017 11:59
-
-
Save ariankordi/7c2e07a505a5c6415d0f3f565036ad0c to your computer and use it in GitHub Desktop.
Little script to get a Mii from an NNID using miiverse.nintendo.net (and lxml + urllib)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import html | |
from urllib.request import urlopen | |
import sys | |
if not sys.argv[1]: | |
print("UsagE: " + sys.argv[0] + " [NNID to get Mii from]") | |
ftree = html.fromstring(urlopen('https://miiverse.nintendo.net/users/{0}/favorites'.format(sys.argv[1])).read()) | |
miihash = ftree.xpath('//*[@id="sidebar-profile-body"]/div/a/img/@src')[0].split('.net/')[1].split('_n')[0] | |
screenname = ftree.xpath('//*[@id="sidebar-profile-body"]/a/text()')[0] | |
print(miihash, screenname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment