How to display twitter user timeline?

时间秒杀一切 提交于 2019-12-12 02:14:07

问题


I'm getting a twitter user timeline by this code:

http://pastebin.com/LrzRVM8g

But I don't know how to display user timeline on website from ascx file. Pls help me..


回答1:


The ascx file is simply a usercontrol. You can add the control to your page and loop through the data sent and populate other controls on your form or webpage.

List[dynamic] objects = serializer.Deserialize[List[dynamic]]{responseData};

The line above from the code gives a list of dynamic objects from the JSON data returned. Since the type is dynamic, you would need to know the JSON parameters when you try to read the data in order to map the values accordingly.

You can simply do a for loop on the "objects" object and put a breakpoint within the loop to see what the return values are. After you see the values, you can do whatever you want with them.

p.s: You will need to change the secret and consumer keys to match the actual keys given for the user timeline from Twitter. (I hope the ones visible in the sample code are not the actual real ones you will be using).



来源:https://stackoverflow.com/questions/24629332/how-to-display-twitter-user-timeline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!