Revision: 131
Author: nopqrs
Date: Sat Jun 5 14:20:58 2010
Log: Fixed bug when adding feeds (probably introduced by moving to Flex
3.5).
Cleaned up some outdated feeds from the sample feed list.
http://code.google.com/p/snackr/source/detail?r=131
Modified:
/trunk/Snackr/src/model/feeds/FeedModel.as
/trunk/Snackr/src/sampleFeeds.xml
=======================================
--- /trunk/Snackr/src/model/feeds/FeedModel.as Sat Nov 15 11:25:48 2008
+++ /trunk/Snackr/src/model/feeds/FeedModel.as Sat Jun 5 14:20:58 2010
@@ -45,6 +45,7 @@
import model.utils.FeedUtils;
import mx.collections.ArrayCollection;
+ import mx.rpc.AsyncToken;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
@@ -129,6 +130,11 @@
*/
private var _statements: FeedStatements;
+ /**
+ * Map of service tokens to URLs, so we can retrieve them when a service
call returns.
+ */
+ private var _tokenURLs: Object = new Object();
+
/**
* Constructor.
* @param sqlConnection The connection we should use to access the local
database.
@@ -420,7 +426,8 @@
service.headers = { Referer: "-" };
service.addEventListener(ResultEvent.RESULT, handleFeedURLCheckResult);
service.addEventListener(FaultEvent.FAULT, handleFeedURLCheckFault);
- service.send();
+ var token: AsyncToken = service.send();
+ _tokenURLs[token] = url;
}
/**
@@ -428,7 +435,8 @@
* This just redispatches an event to whoever might be interested.
*/
private function handleFeedURLCheckFault(event: FaultEvent): void {
- dispatchEvent(new FeedModelEvent(FeedModelEvent.INVALID_FEED,
HTTPService(event.target).url));
+ dispatchEvent(new FeedModelEvent(FeedModelEvent.INVALID_FEED,
_tokenURLs[event.token]));
+ delete _tokenURLs[event.token];
}
/**
@@ -436,7 +444,8 @@
*/
private function handleFeedURLCheckResult(event: ResultEvent): void {
var result: String = String(event.result);
- var url: String = HTTPService(event.target).url;
+ var url: String = _tokenURLs[event.token];
+ delete _tokenURLs[event.token];
var isValid: Boolean = false;
// Looks like we can't get the content-type (headers seems to be null
often).
=======================================
--- /trunk/Snackr/src/sampleFeeds.xml Sun Jul 6 21:51:50 2008
+++ /trunk/Snackr/src/sampleFeeds.xml Sat Jun 5 14:20:58 2010
@@ -36,32 +36,20 @@
<outline text="nj - much ado about something"
xmlUrl="
http://www.rictus.com/muchado/feed/"
htmlUrl="
http://www.rictus.com/muchado"/>
<outline text="Flex Team Blog"
xmlUrl="
http://blogs.adobe.com/flex/atom.xml"
htmlUrl="
http://blogs.adobe.com/flex"/>
<outline text="Latest Adobe News"
xmlUrl="
http://feeds.adobe.com/xml/rss.cfm?query=byMostRecent&languages=1"
htmlUrl="
http://feeds.adobe.com"/>
- <outline text="Matt Chotin's Blog"
xmlUrl="
http://weblogs.macromedia.com/mchotin/atom.xml"
htmlUrl="
http://weblogs.macromedia.com/mchotin"/>
<outline text="A List Apart"
xmlUrl="
http://www.alistapart.com/rss.xml"
htmlUrl="
http://www.alistapart.com/"/>
<outline text="Adobe Blogs" xmlUrl="
http://blogs.adobe.com/index.xml"
htmlUrl="
http://blogs.adobe.com/"/>
<outline text="Ars Technica"
xmlUrl="
http://feeds.arstechnica.com/arstechnica/BAaf" htmlUrl="<link
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0">
http://arstechnica.com/index.ars</link>
<atom10:link
rel="self" href="
http://arstechnica.com/index.ars/rss"
type="application/rss+xml"
xmlns:atom10="
http://www.w3.org/2005/Atom"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0"/>"/>
- <outline text="Astronomy Picture of the Day"
xmlUrl="
http://www.jwz.org/cheesegrater/RSS/apod.rss"
htmlUrl="
http://antwrp.gsfc.nasa.gov/apod/"/>
<outline text="BBC News | News Front Page | UK Edition"
xmlUrl="
http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml"
htmlUrl="
http://news.bbc.co.uk/go/rss/-/1/hi/default.stm"/>
<outline text="Boing Boing" xmlUrl="
http://boingboing.net/rss.xml"
htmlUrl="<link
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0">
http://www.boingboing.net/</link>
<atom10:link
rel="self"
href="
http://feeds.feedburner.com/boingboing/iBag"
type="application/rss+xml"
xmlns:atom10="
http://www.w3.org/2005/Atom"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0"/>"/>
- <outline text="Buntel Blog"
xmlUrl="
http://www.buntel.com/blog/rss.cfm?mode=full"
htmlUrl="
http://www.buntel.com/blog/index.cfm"/>
<outline text="CNET News.com"
xmlUrl="
http://news.com.com/2547-1_3-0-5.xml"
htmlUrl="
http://www.news.com/"/>
<outline text="Christian Science Monitor | Top Stories"
xmlUrl="
http://www.csmonitor.com/rss/top.rss" htmlUrl="<link
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0">
http://csmonitor.com</link>
<atom10:link
rel="self" href="
http://www.csmonitor.com/rss/top.rss"
type="application/rss+xml"
xmlns:atom10="
http://www.w3.org/2005/Atom"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0"/>"/>
<outline text="Dictionary.com Word of the Day"
xmlUrl="
http://dictionary.reference.com/wordoftheday/wotd.rss"
htmlUrl="
http://www.dictionary.com/wordoftheday/"/>
<outline text="Encyclopædia Britannica Online Daily Content"
xmlUrl="
http://www.britannica.com/eb/dailycontent/rss"
htmlUrl="
http://www.britannica.com/?source=RSSOTD"/>
- <outline text="Mark Anders' Blog"
xmlUrl="
http://www.andersblog.com/index.rdf"
htmlUrl="
http://www.andersblog.com/"/>
<outline text="MetaFilter" xmlUrl="
http://xml.metafilter.com/rss.xml"
htmlUrl="<link xmlns:dc="
http://purl.org/dc/elements/1.1/"
xmlns:admin="
http://webns.net/mvcb/"
xmlns:content="
http://purl.org/rss/1.0/modules/content/"
xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0">
http://www.metafilter.com/</link>
<atom10:link
rel="self"
href="
http://feeds.feedburner.com/Metafilter"
type="application/rss+xml"
xmlns:atom10="
http://www.w3.org/2005/Atom"
xmlns:dc="
http://purl.org/dc/elements/1.1/"
xmlns:admin="
http://webns.net/mvcb/"
xmlns:content="
http://purl.org/rss/1.0/modules/content/"
xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0"/>"/>
<outline text="NYT > NYTimes.com Home"
xmlUrl="
http://www.nytimes.com/services/xml/rss/userland/HomePage.xml"
htmlUrl="
http://www.nytimes.com/pages/index.html?partner=rssuserland"/>
- <outline text="News: Digital Photography Review (
dpreview.com)"
xmlUrl="
http://www.dpreview.com/feeds/news.xml"
htmlUrl="
http://www.dpreview.com/"/>
<outline text="Official Google Blog"
xmlUrl="
http://googleblog.blogspot.com/atom.xml"
htmlUrl="
http://googleblog.blogspot.com/http://www.blogger.com/feeds/10861780/posts/default?alt=atom&start-index=26&max-results=25&redirect=falsehttp://googleblog.blogspot.com/feeds/posts/defaulthttp://feeds.feedburner.com/blogspot/MKuf"/>
- <outline text="Quietly Scheming"
xmlUrl="
http://www.quietlyscheming.com/blog/feed/"
htmlUrl="
http://www.quietlyscheming.com/blog"/>
- <outline text="Rob Adams's User Eccentric"
xmlUrl="
http://usereccentric.com/index.rdf"
htmlUrl="
http://usereccentric.com/"/>
<outline text="Slashdot" xmlUrl="
http://slashdot.org/index.rss"
htmlUrl="
http://slashdot.org/"/>
<outline text="The Register"
xmlUrl="
http://www.theregister.co.uk/tonys/slashdot.rdf"
htmlUrl="
http://www.theregister.co.uk/"/>
<outline text="Wired: Top Stories"
xmlUrl="
http://www.wired.com/news_drop/netcenter/netcenter.rdf"
htmlUrl="<link
xmlns:pheedo="
http://www.pheedo.com/namespace/pheedo"
xmlns:taxo="
http://purl.org/rss/1.0/modules/taxonomy/"
xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:itunes="
http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:dc="
http://purl.org/dc/elements/1.1/"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0">
http://www.wired.com/rss/index.xml</link>
<atom10:link
rel="self" href="
http://feeds.wired.com/wired/index"
type="application/rss+xml"
xmlns:atom10="
http://www.w3.org/2005/Atom"
xmlns:pheedo="
http://www.pheedo.com/namespace/pheedo"
xmlns:taxo="
http://purl.org/rss/1.0/modules/taxonomy/"
xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:itunes="
http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:dc="
http://purl.org/dc/elements/1.1/"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0"/>"/>
- <outline text="
blog.FlexExamples.com"
xmlUrl="
http://feeds.feedburner.com/FlexExamples?format=xml"
htmlUrl="<link
xmlns:content="
http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="
http://wellformedweb.org/CommentAPI/"
xmlns:dc="
http://purl.org/dc/elements/1.1/"
xmlns:geo="
http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0">
http://blog.flexexamples.com</link>
<atom10:link
rel="self"
href="
http://feeds.feedburner.com/FlexExamples"
type="application/rss+xml"
xmlns:atom10="
http://www.w3.org/2005/Atom"
xmlns:content="
http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="
http://wellformedweb.org/CommentAPI/"
xmlns:dc="
http://purl.org/dc/elements/1.1/"
xmlns:geo="
http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:feedburner="
http://rssnamespace.org/feedburner/ext/1.0"/>"/>
- <outline text="david zuckerman/adobe"
xmlUrl="
http://davidzuckerman.com/adobe/feed/"
htmlUrl="
http://davidzuckerman.com/adobe"/>
- <outline text="eismann-sf"
xmlUrl="
http://feeds.feedburner.com/Eismann-sf?format=xml"
htmlUrl="<link
xmlns:content="
http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="
http://wellformedweb.org/CommentAPI/"
xmlns:dc="
http://purl.org/dc/elements/1.1/">
http://eismann-sf.com/news</link>
<atom10:link
rel="self"
href="
http://feeds.feedburner.com/Eismann-sf"
type="application/rss+xml"
xmlns:atom10="
http://www.w3.org/2005/Atom"
xmlns:content="
http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="
http://wellformedweb.org/CommentAPI/"
xmlns:dc="
http://purl.org/dc/elements/1.1/"/>"/>
- <outline text="iamdeepa on flex"
xmlUrl="
http://iamdeepa.com/blog/?feed=rss2"
htmlUrl="
http://iamdeepa.com/blog"/>
- <outline text="mikemo" xmlUrl="
http://www.morearty.com/blog/feed/"
htmlUrl="
http://www.morearty.com/blog"/>
</body>
</opml>