[snackr] r131 committed - Fixed bug when adding feeds (probably introduced by moving to Flex 3.5...

0 views
Skip to first unread message

codesite...@google.com

unread,
Jun 5, 2010, 5:21:31 PM6/5/10
to snackr-...@googlegroups.com
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="&lt;link
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;>http://arstechnica.com/index.ars&lt;/link>&#xA;&lt;atom10:link
rel=&quot;self&quot; href=&quot;http://arstechnica.com/index.ars/rss&quot;
type=&quot;application/rss+xml&quot;
xmlns:atom10=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;/>"/>
- <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="&lt;link
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;>http://www.boingboing.net/&lt;/link>&#xA;&lt;atom10:link
rel=&quot;self&quot;
href=&quot;http://feeds.feedburner.com/boingboing/iBag&quot;
type=&quot;application/rss+xml&quot;
xmlns:atom10=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;/>"/>
- <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="&lt;link
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;>http://csmonitor.com&lt;/link>&#xA;&lt;atom10:link
rel=&quot;self&quot; href=&quot;http://www.csmonitor.com/rss/top.rss&quot;
type=&quot;application/rss+xml&quot;
xmlns:atom10=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;/>"/>
<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="&lt;link xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
xmlns:admin=&quot;http://webns.net/mvcb/&quot;
xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;>http://www.metafilter.com/&lt;/link>&#xA;&lt;atom10:link
rel=&quot;self&quot;
href=&quot;http://feeds.feedburner.com/Metafilter&quot;
type=&quot;application/rss+xml&quot;
xmlns:atom10=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
xmlns:admin=&quot;http://webns.net/mvcb/&quot;
xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;/>"/>
<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&amp;start-index=26&amp;max-results=25&amp;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="&lt;link
xmlns:pheedo=&quot;http://www.pheedo.com/namespace/pheedo&quot;
xmlns:taxo=&quot;http://purl.org/rss/1.0/modules/taxonomy/&quot;
xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
xmlns:itunes=&quot;http://www.itunes.com/dtds/podcast-1.0.dtd&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;>http://www.wired.com/rss/index.xml&lt;/link>&#xA;&lt;atom10:link
rel=&quot;self&quot; href=&quot;http://feeds.wired.com/wired/index&quot;
type=&quot;application/rss+xml&quot;
xmlns:atom10=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:pheedo=&quot;http://www.pheedo.com/namespace/pheedo&quot;
xmlns:taxo=&quot;http://purl.org/rss/1.0/modules/taxonomy/&quot;
xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
xmlns:itunes=&quot;http://www.itunes.com/dtds/podcast-1.0.dtd&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;/>"/>
- <outline text="blog.FlexExamples.com"
xmlUrl="http://feeds.feedburner.com/FlexExamples?format=xml"
htmlUrl="&lt;link
xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
xmlns:geo=&quot;http://www.w3.org/2003/01/geo/wgs84_pos#&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;>http://blog.flexexamples.com&lt;/link>&#xA;&lt;atom10:link
rel=&quot;self&quot;
href=&quot;http://feeds.feedburner.com/FlexExamples&quot;
type=&quot;application/rss+xml&quot;
xmlns:atom10=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
xmlns:geo=&quot;http://www.w3.org/2003/01/geo/wgs84_pos#&quot;
xmlns:feedburner=&quot;http://rssnamespace.org/feedburner/ext/1.0&quot;/>"/>
- <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="&lt;link
xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;>http://eismann-sf.com/news&lt;/link>&#xA;&lt;atom10:link
rel=&quot;self&quot;
href=&quot;http://feeds.feedburner.com/Eismann-sf&quot;
type=&quot;application/rss+xml&quot;
xmlns:atom10=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;/>"/>
- <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>
Reply all
Reply to author
Forward
0 new messages