Twitter api 身份验证 flex 移动 flash 生成器
Twitter api authentication flex mobile flash builder
我正在使用 Flash Builder 4.6 制作移动应用程序。
应该显示一些带有特定主题标签的推文。
经过很长时间的搜索,我终于找到了一份对我有帮助的文件。
我正在使用本指南 http://www.adobe.com/content/dam/Adobe/en/devnet/flex/articles/twitter-trends/build-first-mobile-flex-app.pdf
但它使用旧版本的推特 API。
现在它需要授权。
而且我对 Flash Builder 完全陌生,所以我不知道我必须在哪里(在哪个文件中)或我应该在那里输入什么...
我们已经解决了,
这是我们授权 api 和 get/show 推文的源代码示例。
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="TOUS ENSEMBLE"
initialize="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:ArrayCollection id="tweets" />
</fx:Declarations>
<s:states>
<s:State name="normal" />
<s:State name="busy"/>
<s:State name="networkError"/>
</s:states>
<s:List id="list" top="0" left="0" right="0" bottom="0" dataProvider=" {tweets}">
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:Image source="{data.user.profile_image_url}" left="0" verticalCenter="0" width="60" height="60"/>
<s:Label text="{data.text}" left="65" right="5" top="5" bottom="5"/>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
<s:BusyIndicator id="busy" verticalCenter="0" horizontalCenter="0" width="60" height="60" includeIn="busy"/>
<s:Label id="networkError" verticalCenter="0" horizontalCenter="0" text="Network Error Occured" includeIn="networkError"/>
<fx:Script>
<![CDATA[
import de.danielyan.twitterAppOnly.TwitterSocket;
import de.danielyan.twitterAppOnly.TwitterSocketEvent;
private var _twitter:TwitterSocket;
private var searchTweetKeyword;
public function init():void
{
_twitter = new TwitterSocket('I9ItnPjy670SsLOBcas5pJHGY', 'GpuPGqrCfRm53LpayKOVtGjdOFZNY3mTycQHJc2vf3SAeXDqME');
// twitter socket uses two events:
_twitter.addEventListener(TwitterSocket.EVENT_TWITTER_READY, onTwitterReady);
// * The Twitter Data event, when the twitter Request has finished
_twitter.addEventListener(TwitterSocket.EVENT_TWITTER_RESPONSE, onTwitterData);
// * Catch IO Errors! This happens when no network is available
_twitter.addEventListener(IOErrorEvent.IO_ERROR,onError);
currentState="busy";
}
public function onError(event:Event):void
{
currentState="networkError";
}
public function onTwitterReady(event:Event):void
{
_twitter.request("/1.1/search/tweets.json?q=#belgianreddevils");
}
public function onTwitterData(event:TwitterSocketEvent):void
{
// this message is
currentState="normal";
var tweetList = new ArrayCollection(event.response.statuses as Array);
//tweets = new ArrayCollection(event.response.statuses as Array);
trace(tweetList[0].text);
tweets = tweetList;
}
]]>
</fx:Script>
</s:View>
我们使用了我提供的 pdf 和这份 github 文档的帮助
https://github.com/denisdanielyan/as3-Application-Only-Twitter
我正在使用 Flash Builder 4.6 制作移动应用程序。 应该显示一些带有特定主题标签的推文。 经过很长时间的搜索,我终于找到了一份对我有帮助的文件。 我正在使用本指南 http://www.adobe.com/content/dam/Adobe/en/devnet/flex/articles/twitter-trends/build-first-mobile-flex-app.pdf 但它使用旧版本的推特 API。 现在它需要授权。 而且我对 Flash Builder 完全陌生,所以我不知道我必须在哪里(在哪个文件中)或我应该在那里输入什么...
我们已经解决了,
这是我们授权 api 和 get/show 推文的源代码示例。
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="TOUS ENSEMBLE"
initialize="init()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:ArrayCollection id="tweets" />
</fx:Declarations>
<s:states>
<s:State name="normal" />
<s:State name="busy"/>
<s:State name="networkError"/>
</s:states>
<s:List id="list" top="0" left="0" right="0" bottom="0" dataProvider=" {tweets}">
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:Image source="{data.user.profile_image_url}" left="0" verticalCenter="0" width="60" height="60"/>
<s:Label text="{data.text}" left="65" right="5" top="5" bottom="5"/>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
<s:BusyIndicator id="busy" verticalCenter="0" horizontalCenter="0" width="60" height="60" includeIn="busy"/>
<s:Label id="networkError" verticalCenter="0" horizontalCenter="0" text="Network Error Occured" includeIn="networkError"/>
<fx:Script>
<![CDATA[
import de.danielyan.twitterAppOnly.TwitterSocket;
import de.danielyan.twitterAppOnly.TwitterSocketEvent;
private var _twitter:TwitterSocket;
private var searchTweetKeyword;
public function init():void
{
_twitter = new TwitterSocket('I9ItnPjy670SsLOBcas5pJHGY', 'GpuPGqrCfRm53LpayKOVtGjdOFZNY3mTycQHJc2vf3SAeXDqME');
// twitter socket uses two events:
_twitter.addEventListener(TwitterSocket.EVENT_TWITTER_READY, onTwitterReady);
// * The Twitter Data event, when the twitter Request has finished
_twitter.addEventListener(TwitterSocket.EVENT_TWITTER_RESPONSE, onTwitterData);
// * Catch IO Errors! This happens when no network is available
_twitter.addEventListener(IOErrorEvent.IO_ERROR,onError);
currentState="busy";
}
public function onError(event:Event):void
{
currentState="networkError";
}
public function onTwitterReady(event:Event):void
{
_twitter.request("/1.1/search/tweets.json?q=#belgianreddevils");
}
public function onTwitterData(event:TwitterSocketEvent):void
{
// this message is
currentState="normal";
var tweetList = new ArrayCollection(event.response.statuses as Array);
//tweets = new ArrayCollection(event.response.statuses as Array);
trace(tweetList[0].text);
tweets = tweetList;
}
]]>
</fx:Script>
</s:View>
我们使用了我提供的 pdf 和这份 github 文档的帮助 https://github.com/denisdanielyan/as3-Application-Only-Twitter