从Twitter检索数据 [英] Retrieving data from Twitter
问题描述
大家好,
我有一个asp.net 3.5页,使用twitter api从Twitter检索推文如下:
https://api.twitter.com/1.1/statuses/user_timeline.json?count=10&screen_name=BillGates
它工作并检索最新的10条推文,但有一个问题:
推文文字如下:
财富不是衡量人类幸福的唯一标准。以下是其他几个
它应该是:
财富并不是衡量人类幸福的唯一标准。以下是其他一些因素
即来自 \ u2019
和所有阿拉伯字符都有这种格式
如何显示推文的格式是否正确?
提前感谢
在这里查看类似的讨论。可能会有帮助!
http ://stackoverflow.com/questions/4211806/json-from-twitter-api-contains-u2019 [ ^ ]
你必须使用正则表达式来过滤掉那些特殊字符。试试吧。祝你好运! :)
C#Regex.Match
用于定义正则表达式的构造 的
Hi All,
I have an asp.net 3.5 page that uses twitter api to retrieve tweets from Twitter as following:
"https://api.twitter.com/1.1/statuses/user_timeline.json?count=10&screen_name=BillGates"
it's working and retrieve the latest 10 tweets but there is a problem:
the tweets text come as following:
"Wealth isn\u2019t the only measure of human happiness. Here are a few others"
it should be:
"Wealth isn't the only measure of human happiness. Here are a few others"
i.e. the " ' " comes as " \u2019 "
and all the Arabic characters come in this format
how can I show the tweets text in its correct format?
thanks in advance
Look at a similar discussion here. Might help!
http://stackoverflow.com/questions/4211806/json-from-twitter-api-contains-u2019[^]
You have to use the Regular Expressions to filter out that special characters.Try it.Good Luck ! :)
C# Regex.Match
Constructs for Defining Regular Expressions
这篇关于从Twitter检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!