My favorites
|
Sign in
undolibrary
Undolog coding repository
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
‹r95
r177
Source path:
svn
/
trunk
/
air
/
FeedBurner
/
FeedBurner.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package {
/**
* Class Document for FeedBurner Adobe AIR version
* Original idea by Napolux.com (http://www.napolux.com/2008/flex-3-adobe-air-feedburner.html)
*
* @author Giovambattista Fazioli
* @email g.fazioli@undolog.com
* @web http://www.undolog.com
*
* CHANGE LOG
*
* ver 0.1
* - First Adobe AIR release
*
*/
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequestMethod;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.net.URLVariables;
public class FeedBurner extends MovieClip {
private const FEEDBURNER_API :String = 'http://api.feedburner.com/awareness/1.0/GetFeedData';
public function FeedBurner():void {
trace("construtor::FeedBurner");
addEventListener( Event.ADDED_TO_STAGE, init );
}
//
private function init( e:Event = null ):void {
result_txt.text = '';
feed_url.text = 'http://www.undolog.com/feed';
//
check_btn.addEventListener( MouseEvent.CLICK, checkFeedBurnerReaders );
}
//
private function checkFeedBurnerReaders(e:MouseEvent = null ):void {
trace( "FeedBurner::checkFeedBurnerReaders()" );
//
var loader :URLLoader = new URLLoader();
var urlreq :URLRequest = new URLRequest();
var param :URLVariables = new URLVariables();
//
param.uri = feed_url.text;
urlreq.url = FEEDBURNER_API;
urlreq.method = URLRequestMethod.GET;
urlreq.data = param;
//
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, completeHandler);
try {
loader.load(urlreq);
} catch (error:Error) {
trace("Errore nel caricamento dell' URL");
}
function completeHandler(event:Event):void {
//<rsp stat="ok">
// <feed id="651641" uri="undolog">
// <entry date="2008-11-17" circulation="389" hits="1348" downloads="0" reach="43"/>
// </feed>
//</rsp>
var x_xml :XML = XML(event.target.data);
if( x_xml.@stat == 'ok' ) result_txt.text = x_xml.feed.entry.@circulation.toString();
else result_txt.text = '0';
}
}
}
}
Show details
Hide details
Change log
r96
by g.fazi...@undolog.com on Nov 18, 2008
Diff
[No log message]
Go to:
...ir/FeedBurner/FeedBurner-app.xml
...nk/air/FeedBurner/FeedBurner.air
/trunk/air/FeedBurner/FeedBurner.as
...nk/air/FeedBurner/FeedBurner.fla
...nk/air/FeedBurner/FeedBurner.swf
Project members,
sign in
to write a code review
Older revisions
r95
by g.fazi...@undolog.com on Nov 18, 2008
Diff
[No log message]
r94
by g.fazi...@undolog.com on Nov 18, 2008
Diff
[No log message]
r93
by g.fazi...@undolog.com on Nov 18, 2008
Diff
[No log message]
All revisions of this file
File info
Size: 2239 bytes, 74 lines
View raw file
Hosted by