Windows phone 7 获取特定Windows Phone Marketplace游戏的所有评论
AppHub是否允许我们同时查看来自所有市场的应用程序评论?由于我没有找到,o花了一些时间编写一些代码将它们全部打印到一个文件中,所以我不会浪费时间在每种语言中寻找它们 如果有更好的解决办法,我将不胜感激。在最坏的情况下,我很高兴与任何觉得有用的人分享代码 它使用。 唯一的参数是应用程序的id,如下所示: wp7reviews.py 62289160-6970-4674-85a0-aef3dbe3f93d 这是密码Windows phone 7 获取特定Windows Phone Marketplace游戏的所有评论,windows-phone-7,web-crawler,bots,marketplace,app-hub,Windows Phone 7,Web Crawler,Bots,Marketplace,App Hub,AppHub是否允许我们同时查看来自所有市场的应用程序评论?由于我没有找到,o花了一些时间编写一些代码将它们全部打印到一个文件中,所以我不会浪费时间在每种语言中寻找它们 如果有更好的解决办法,我将不胜感激。在最坏的情况下,我很高兴与任何觉得有用的人分享代码 它使用。 唯一的参数是应用程序的id,如下所示: wp7reviews.py 62289160-6970-4674-85a0-aef3dbe3f93d 这是密码 import sys import getopt from urllib2 im
import sys
import getopt
from urllib2 import URLError
from urllib2 import HTTPError
import urllib2
from BeautifulSoup import BeautifulStoneSoup
opts, extraparams = getopt.getopt(sys.argv[1:], '')
# starts at the second element of argv since the first one is the script name
# extraparms are extra arguments passed after all option/keywords are assigned
# opts is a list containing the pair "option"/"value"
#print 'Opts:',opts
#print 'Extra parameters:',extraparams
try:
appid = extraparams[0]
except:
#Awsome Linkit appid as default appid
appid="62289160-6970-4674-85a0-aef3dbe3f93d"
allreviewsFILE = open("allreviews.txt", "w")
def output(text):
allreviewsFILE.write(text)
#print text,
def outputln(text):
allreviewsFILE.write(text+'\n')
#print text
def geturl(lang):
return "http://catalog.zune.net/v3.2/"+lang+"/apps/"+appid
try:
request = urllib2.Request(geturl("en-us"))
fd = urllib2.urlopen(request)
content = fd.read()
fd.close()
soup = BeautifulStoneSoup(content)
try:
outputln("App title: "+soup.findAll("a:title")[0].string)
outputln("");
except:
print "Failed to get App Title"
langs = ["en-us", "en-gb", "de-de",
"fr-fr", "es-es", "it-it",
"en-au", "de-at", "fr-be",
"fr-ca", "en-ca", "en-hk",
"en-in", "en-ie", "es-mx",
"en-nz", "en-sg", "de-ch",
"fr-ch", "zh-hk", "zh-cn",
"en-hk"]
outputln("Here we got reviews from each marketplace")
for lang in langs:
request = urllib2.Request(geturl(lang)+"/reviews")
fd = urllib2.urlopen(request)
print "Fetching "+lang+"...",
content = fd.read()
fd.close()
print "OK"
soup = BeautifulStoneSoup(content)
#print soup.prettify()
contents = soup.findAll("a:content")
ratings = soup.findAll("userrating")
l = len(contents)
if l > 0:
outputln("----------- "+lang+" ---------------------------------------------------")
outputln("")
for i in range(0, l):
output(ratings[i].string+"/10 - ")
if len(contents[i].contents) > 0:
try:
outputln(contents[i].contents[0])
except:
outputln("*** Unknown chars ***")
else:
outputln("Rating only")
outputln("")
except HTTPError, e:
print("Error during request!\n")
print("Cod.: ", e.code)
except URLError, e:
print("Invalid URL!\n")
print("Message: ", e.reason)
已经有一个网站向您提供此信息。看一看还有一个名为WP7的免费应用程序,它允许您跟踪来自不同地区的评论,并将其翻译成您的母语。这正是我要找的。不客气。此外,AppTracker+正在开发中,应该很快就能提供;)