windows store api 访问地铁和电话应用程序信息 [英] windows store api to access metro and phone apps information

查看:49
本文介绍了windows store api 访问地铁和电话应用程序信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有用于地铁和电话应用程序的官方微软 api,我们可以连接并获取有关应用程序、下载、发布者等的信息.

May I know is there any official microsoft api for metro and phone apps which we can connect and get information about apps, downloads, publishers etc.

我认为 live api 仅适用于连接 Skydrive、hotmail 或 Skype 的应用程序.

I think live api is only for app to connect with skydrive, hotmail or skype.

我可以看到很多网站在他们的网站上提供此类信息.

I can see lots of website providing such information on their website.

提前致谢.

推荐答案

您好,这是我创建的一篇博客文章,概述了该过程:http://jasonthomascarter.blogspot.com/2013/08/the-friendly-开发人员指南-to.html

Hello here is a blog post I created outlining the process: http://jasonthomascarter.blogspot.com/2013/08/the-friendly-developers-guide-to.html

我们开始!首先,我们将从 Windows 应用商店网站的 Robots.txt 文件开始.http://apps.microsoft.com/robots.txt

Here we go! First we will start with Robots.txt file for the Windows Store website. http://apps.microsoft.com/robots.txt

网站使用 robots.txt 来指导网络爬虫如何行为、他们希望他们看到什么以及他们不希望他们看到什么.

Websites use robots.txt to guide web crawlers on how to behave, what they want them to see, and what they don't want them to see.

http://www.robotstxt.org/

网络机器人(也称为网络漫游器、爬行器或蜘蛛)是自动遍历网络的程序.Google 等搜索引擎使用它们来为网络内容编制索引,垃圾邮件发送者使用它们来扫描电子邮件地址,它们还有许多其他用途.

Web Robots (also known as Web Wanderers, Crawlers, or Spiders), are programs that traverse the Web automatically. Search engines such as Google use them to index the web content, spammers use them to scan for email addresses, and they have many other uses.

在这种情况下,Sitemaps.xml 索引文件是我们感兴趣的.http://apps.microsoft.com/windows/sitemap_index.xml

In this case the Sitemaps.xml index file is what we are interested in. http://apps.microsoft.com/windows/sitemap_index.xml

http://www.sitemaps.org/

站点地图是网站管理员向搜索引擎通知其网站上可供抓取的网页的一种简单方式.以最简单的形式,站点地图是一个 XML 文件,其中列出了站点的 URL 以及关于每个 URL 的附加元数据(上次更新时间、更改频率以及相对于站点中其他 URL 的重要性)) 以便搜索引擎可以更智能地抓取网站.

Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site.

站点地图索引文件列出了每个单独的站点地图 XML 文件.在撰写本文时,apps.microsoft.com 网站有 141 个单独的站点地图 XML 文件.

The Sitemap Index file lists out each of the individual Sitemap XML files. As of this writing, the apps.microsoft.com website has 141 individual Sitemap XML files.

在单个文件中包含数千个指向 Windows 应用商店应用程序网页的 URL.例如这个指向 PlayTo Receiver 应用的 URL:

Inside the individual files are thousands of URL's to the web pages of Windows Store apps. Such as this URL to the PlayTo Receiver app:

http://apps.microsoft.com/windows/en-us/app/playto-receiver/72a6ba17-2d4e-4a1c-bcfb-cdc5d4b32d0e

这些应用的网页确实包含了大量信息,我们可以从 HTML 中抓取这些信息,但我们可以做得更好....我们在此处获得的关键信息是应用 ID 以及这些应用 ID 发布的地理位置到店里.

These webpages for the apps do include a good bit of information that we could scrape from the HTML but we can do better.... The key information we are getting here is the App ID's and which geographies those App ID's are published to in the store.

例如:

72a6ba17-2d4e-4a1c-bcfb-cdc5d4b32d0e

72a6ba17-2d4e-4a1c-bcfb-cdc5d4b32d0e

和 en-us 等...

and en-us etc...

现在是好东西,我们可以使用我们新发现的应用 ID 和地理信息调用一些网络服务.

And now to the good stuff, there a few web services we can call using our newly found App Id's and geography information.

https://services.apps.microsoft.com/browse/6.2.9200-1/615/en-US_en-US/c/US/cp/10005001/Apps/72a6ba17-2d4e-4a1c-bcfb-cdc5d4b32d0e

此网络服务提供了大量信息,但元素名称并未明确说明.这是我对其中许多(不是全部)的解释,让您开始.

There is plenty of information available through this web service but it's not clearly spelled out by the element names. Here is my interpretation of many (not all) of them to start you off.

sSubCategoryName = rawXML.getElementsByTagName('Sc')[0].getElementsByTagName('N')[0].childNodes[0].nodeValue;

sSubCategoryName = rawXML.getElementsByTagName('Sc')[0].getElementsByTagName('N')[0].childNodes[0].nodeValue;

sSubCategoryId = rawXML.getElementsByTagName('Sc')[0].getElementsByTagName('I')[0].childNodes[0].nodeValue;

sSubCategoryId = rawXML.getElementsByTagName('Sc')[0].getElementsByTagName('I')[0].childNodes[0].nodeValue;

sHasTrial = rawXML.getElementsByTagName('Try')[0].childNodes[0].nodeValue;

sHasTrial = rawXML.getElementsByTagName('Try')[0].childNodes[0].nodeValue;

sDescription = rawXML.getElementsByTagName('D')[0].childNodes[0].nodeValue;

sDescription = rawXML.getElementsByTagName('D')[0].childNodes[0].nodeValue;

sDeveloper = rawXML.getElementsByTagName('Dev')[0].childNodes[0].nodeValue;

sDeveloper = rawXML.getElementsByTagName('Dev')[0].childNodes[0].nodeValue;

sWebsite = rawXML.getElementsByTagName('Ws')[0].childNodes[0].nodeValue;

sWebsite = rawXML.getElementsByTagName('Ws')[0].childNodes[0].nodeValue;

sSupport = rawXML.getElementsByTagName('Sws')[0].childNodes[0].nodeValue;

sSupport = rawXML.getElementsByTagName('Sws')[0].childNodes[0].nodeValue;

sPrivacy = rawXML.getElementsByTagName('Pu')[0].childNodes[0].nodeValue;

sPrivacy = rawXML.getElementsByTagName('Pu')[0].childNodes[0].nodeValue;

sCategoryName = rawXML.getElementsByTagName('C')[0].getElementsByTagName('N')[0].childNodes[0].nodeValue;

sCategoryName = rawXML.getElementsByTagName('C')[0].getElementsByTagName('N')[0].childNodes[0].nodeValue;

sCategoryId = rawXML.getElementsByTagName('C')[0].getElementsByTagName('I')[0].childNodes[0].nodeValue;

sCategoryId = rawXML.getElementsByTagName('C')[0].getElementsByTagName('I')[0].childNodes[0].nodeValue;

sPrice = rawXML.getElementsByTagName('P')[0].childNodes[0].nodeValue;

sPrice = rawXML.getElementsByTagName('P')[0].childNodes[0].nodeValue;

sForegroundColor = rawXML.getElementsByTagName('Fg')[0].childNodes[0].nodeValue;

sForegroundColor = rawXML.getElementsByTagName('Fg')[0].childNodes[0].nodeValue;

sBackgroundColor = rawXML.getElementsByTagName('Bg')[0].childNodes[0].nodeValue;

sBackgroundColor = rawXML.getElementsByTagName('Bg')[0].childNodes[0].nodeValue;

sAppIcon = rawXML.getElementsByTagName('Ico')[0].childNodes[0].nodeValue;

sAppIcon = rawXML.getElementsByTagName('Ico')[0].childNodes[0].nodeValue;

sAppName = rawXML.getElementsByTagName('T')[0].childNodes[0].nodeValue;

sAppName = rawXML.getElementsByTagName('T')[0].childNodes[0].nodeValue;

sPackageFamilyName = rawXML.getElementsByTagName('Pfn')[0].childNodes[0].nodeValue;

sPackageFamilyName = rawXML.getElementsByTagName('Pfn')[0].childNodes[0].nodeValue;

sResourceId = rawXML.getElementsByTagName('R')[0].childNodes[0].nodeValue;

sResourceId = rawXML.getElementsByTagName('R')[0].childNodes[0].nodeValue;

sId = rawXML.getElementsByTagName('I')[0].childNodes[0].nodeValue;

sId = rawXML.getElementsByTagName('I')[0].childNodes[0].nodeValue;

sCapabilities = sCapabilities + arrCapabilities[k].childNodes[0].nodeValue+",";

sCapabilities = sCapabilities + arrCapabilities[k].childNodes[0].nodeValue+",";

sUpdate = rawXML.getElementsByTagName('Ud')[0].childNodes[0].nodeValue;

sUpdate = rawXML.getElementsByTagName('Ud')[0].childNodes[0].nodeValue;

sFeatures1 = rawXML.getElementsByTagName('Dbp')[0].childNodes[0].nodeValue;

sFeatures1 = rawXML.getElementsByTagName('Dbp')[0].childNodes[0].nodeValue;

sFeatures2 = rawXML.getElementsByTagName('Dbp')[1].childNodes[0].nodeValue;

sFeatures2 = rawXML.getElementsByTagName('Dbp')[1].childNodes[0].nodeValue;

sFeatures3 = rawXML.getElementsByTagName('Dbp')[2].childNodes[0].nodeValue;

sFeatures3 = rawXML.getElementsByTagName('Dbp')[2].childNodes[0].nodeValue;

sFeatures4 = rawXML.getElementsByTagName('Dbp')[3].childNodes[0].nodeValue;

sFeatures4 = rawXML.getElementsByTagName('Dbp')[3].childNodes[0].nodeValue;

sFeatures5 = rawXML.getElementsByTagName('Dbp')[4].childNodes[0].nodeValue;

sFeatures5 = rawXML.getElementsByTagName('Dbp')[4].childNodes[0].nodeValue;

sFeatures6 = rawXML.getElementsByTagName('Dbp')[5].childNodes[0].nodeValue;

sFeatures6 = rawXML.getElementsByTagName('Dbp')[5].childNodes[0].nodeValue;

sFeatures7 = rawXML.getElementsByTagName('Dbp')[6].childNodes[0].nodeValue;

sFeatures7 = rawXML.getElementsByTagName('Dbp')[6].childNodes[0].nodeValue;

sFeatures8 = rawXML.getElementsByTagName('Dbp')[7].childNodes[0].nodeValue;

sFeatures8 = rawXML.getElementsByTagName('Dbp')[7].childNodes[0].nodeValue;

sFeatures9 = rawXML.getElementsByTagName('Dbp')[8].childNodes[0].nodeValue;

sFeatures9 = rawXML.getElementsByTagName('Dbp')[8].childNodes[0].nodeValue;

sScreenshot1 = rawXML.getElementsByTagName('Ss')[0].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot1 = rawXML.getElementsByTagName('Ss')[0].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot2 = rawXML.getElementsByTagName('Ss')[1].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot2 = rawXML.getElementsByTagName('Ss')[1].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot3 = rawXML.getElementsByTagName('Ss')[2].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot3 = rawXML.getElementsByTagName('Ss')[2].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot4 = rawXML.getElementsByTagName('Ss')[3].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot4 = rawXML.getElementsByTagName('Ss')[3].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot5 = rawXML.getElementsByTagName('Ss')[4].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot5 = rawXML.getElementsByTagName('Ss')[4].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot6 = rawXML.getElementsByTagName('Ss')[5].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot6 = rawXML.getElementsByTagName('Ss')[5].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot7 = rawXML.getElementsByTagName('Ss')[6].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot7 = rawXML.getElementsByTagName('Ss')[6].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot8 = rawXML.getElementsByTagName('Ss')[7].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot8 = rawXML.getElementsByTagName('Ss')[7].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot9 = rawXML.getElementsByTagName('Ss')[8].getElementsByTagName('U')[0].childNodes[0].nodeValue

sScreenshot9 = rawXML.getElementsByTagName('Ss')[8].getElementsByTagName('U')[0].childNodes[0].nodeValue

sCaption1 = rawXML.getElementsByTagName('Ss')[0].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption1 = rawXML.getElementsByTagName('Ss')[0].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption2 = rawXML.getElementsByTagName('Ss')[1].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption2 = rawXML.getElementsByTagName('Ss')[1].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption3 = rawXML.getElementsByTagName('Ss')[2].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption3 = rawXML.getElementsByTagName('Ss')[2].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption4 = rawXML.getElementsByTagName('Ss')[3].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption4 = rawXML.getElementsByTagName('Ss')[3].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption5 = rawXML.getElementsByTagName('Ss')[4].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption5 = rawXML.getElementsByTagName('Ss')[4].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption6 = rawXML.getElementsByTagName('Ss')[5].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption6 = rawXML.getElementsByTagName('Ss')[5].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption7 = rawXML.getElementsByTagName('Ss')[6].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption7 = rawXML.getElementsByTagName('Ss')[6].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption8 = rawXML.getElementsByTagName('Ss')[7].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

sCaption8 = rawXML.getElementsByTagName('Ss')[7].getElementsByTagName('Cap')[0].childNodes[0].nodeValue

Windows 应用商店不仅仅是应用程序,还有评论,而且很多.Windows 应用商店中的应用程序目前有超过 210,000 条评论.这些评论来自世界各地,所以你需要一些国家代码,你方便的花花公子App Id,注意最后的pn/1,你会发现这个服务每页只返回10条评论,只是递增将此值设置为 pn/2、pn/3 等.直到您的评论用完为止.

There is more to the Windows Store than just apps, there are also reviews, and lots of them. There are currently over 210,000 reviews for apps in the Windows Store. These reviews come from all over the world, so you'll need some country codes, your handy dandy App Id's and pay attention to the pn/1 at the end, you will find that this service only returns 10 reviews per page, just increment this value to pn/2, pn/3 etc.. until you run out of reviews.

var arrCountryCodes = ["AE", "AR", "AT", "AU", "BE", "BG", "BH", "CA", "CH", "CL", "CN", "CO", "CR", "CY", "CZ", "DE", "DK", "DZ", "EE", "EG", "ES", "FI", "FR", "GB"、GR"、HK"、HR"、HU"、ID"、IE"、IL"、IN"、IQ"、IT"、JO"、JP", "KW", "KZ", "LB", "LK", "LT", "LU", "LV", "LY", "MA", "MT", "MX", "MY", "NL"、NO"、NZ"、OM"、PE"、PH"、PK"、PL"、QA"、RO"、RS"、RU"、SA", "SE", "SG", "SI", "SK", "TH", "TN", "TR", "TT", "UA", "US", "UY", "VE", "VN"];

var arrCounntryCodes = ["AE", "AR", "AT", "AU", "BE", "BG", "BH", "CA", "CH", "CL", "CN", "CO", "CR", "CY", "CZ", "DE", "DK", "DZ", "EE", "EG", "ES", "FI", "FR", "GB", "GR", "HK", "HR", "HU", "ID", "IE", "IL", "IN", "IQ", "IT", "JO", "JP", "KW", "KZ", "LB", "LK", "LT", "LU", "LV", "LY", "MA", "MT", "MX", "MY", "NL", "NO", "NZ", "OM", "PE", "PH", "PK", "PL", "QA", "RO", "RS", "RU", "SA", "SE", "SG", "SI", "SK", "TH", "TN", "TR", "TT", "UA", "US", "UY", "VE", "VN"];

https://services.apps.microsoft.com/4R/6.2.9200-1/1/en-US/m/US/Apps/f514d64b-8705-43b7-a400-c4f4f3dedfc0/Reviews/all/s/date/1/pn/1

这个对元素名称的描述性要强得多,所以我认为没有必要对此进行进一步解释.您可以看到全名、显示名称、用户选择用来代表自己的图像.

This one is much more descriptive with the element names, so I don't see any need for further explaination of this. You can see the full name, display name, the image the user has chosen to represent themselves with.

接下来我们可以做一些搜索......

Next up we can do a little bit of seaching...

https://services.apps.microsoft.com/search/6.2.9200-1/615/en-US_en-US/m/US/c/US/il/en-US/cp/10005001/query/cid/0/pf/1/pc/0/pt/x64/af/0/lf/0/s/0/2/pn/0?phrase=Software 开发人员

这里又有点神秘了,但现在你应该已经习惯了.您可以从 I 元素获取 App ID 并将其从那里带回浏览服务 f514d64b-8705-43b7-a400-c4f4f3dedfc0

Here it gets a little cryptic again, but by now you should be used to it. You can get the App ID from the I element and take it from there back to the browse service f514d64b-8705-43b7-a400-c4f4f3dedfc0

以上就是从 Windows 应用商店中提取大量信息的基础知识,然后您就可以随心所欲了.如果您觉得这很有用和/或利用这些信息制作了一些应用程序,有一些其他信息要分享,或者请在评论中告诉我

So there you have it, the basics of pulling tons of information out of the Windows Store that you can then do what you please with. If you find this useful and/or make some apps utilizing the information, have some additional information to share or otherwise please let me know in the comments

这篇关于windows store api 访问地铁和电话应用程序信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆