用于Cricinfo的RSS阅读器

编程入门 行业动态 更新时间:2024-10-26 16:29:25
本文介绍了用于Cricinfo的RSS阅读器-显示实时板球比分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想开发用于显示实时板球比分的Windows Phone应用. 目前,我打算显示来自 static.cricinfo/rss/livescores.xml-考虑到该链接将显示所有实时比赛,让我们从上方选择一个链接,假定: 南非与斯里兰卡的对比 现在,我假设我将拥有与第一个链接类似的Xml节点和子元素,例如第一个链接,如"Channels","Title","Description"等,它们形成一个RSS.但是实际实时得分 URL 不包含这些xml节点. 因此,我的问题是是否要显示实时比分,我是否需要解析上述 URL 哪个不包含RSS提要?还是有什么办法?因为如果CricInfo(该站点)决定改变外观,那么我的解析器就会搞砸了. 感谢您的帮助!

I want to develop Windows phone app for displaying live cricket scores. For now, I plan to display RSS feeds from static.cricinfo/rss/livescores.xml - considering that this link will show all the live matches, lets select one of the link from above which is assume: SA Vs Sri Lanka Now, I was assuming I''ll have similar Xml nodes and children as in the first link like "Channels","Title", "Description", etc which forms an RSS. But the actual live score URL does not contain those xml nodes. So, my question is if I were to display the live score, do I need to parse the above URL which does not contain RSS feeds? Or is there any way around? Because if CricInfo (the site) decides to change the look and feel, then my parser will get screwed. Any help is appreciated!

推荐答案

实时比赛页面不是RSS,而是HTML,因此,如果需要实时比赛信息,则需要解析HTML. The live match page is not RSS, it is HTML so you need to parse the HTML if you want the live match information.

blockquote>

我们需要从标签中提取数据.我们应该遍历标签并显示标题标签,它给出了比赛的当前分数. 我们可以使用 static.cricinfo/rss/livescores.xml [ ^ ]源本身. 但是由于您的要求不同,我们需要解析html数据,因为您说的不是rss提要页面,而仅是cos.例如,"playerName"类的标记获取播放器名称,而"battingRuns"类获取运行分数. We need to extract data out of the tags. We should loop through the tags and display the title tag it gives the current score of the match. We can use static.cricinfo/rss/livescores.xml[^] feed itself. But as your requirement is different we need to parse html data only cos as you said its not a rss feed page..For example tag of class "playerName" fetches the player name and class "battingRuns" gets the runs scored..

请注意,Cricinfo上的信息是其版权,因此可能存在侵权问题. Just be aware that the information on Cricinfo is their copyright, so there may be infringement issues.

更多推荐

用于Cricinfo的RSS阅读器

本文发布于:2023-11-11 21:09:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579570.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:阅读器   Cricinfo   RSS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!