UpcoingOrgInfotron
This blueprint is supposed to be connected upstreams to an ajaxwrapper which feed data from the Upcoming.org events site API, so it is kind of specialized. However it is a good template for when you need to do some similar scraping.
BLUEPRINT(
"~01E0DFBB311ED2450cA5AF88A762A653BA",
[
["xml_json_in", "onJsonXml", 10]
],
[
"collection_out"
],
function (Class)
{
Class.prototype.onJsonXml = function(msg)
{
var coll = [];
var n, event, events;
try {
events = msg.children;
n = events.length;
} catch (ex) {
this.error(ex, "malformed JSON RSS output");
return;
/*****************************************************************/
}
for (i = 0; i < n; i++) {
event = events[i];
if (event.attributes) {
coll.push({name:event.attributes["name"],
text_content:event.attributes["description"],
lat:parseFloat(event.attributes["latitude"]),
lon:parseFloat(event.attributes["longitude"]),
date:[new Date(event.attributes["start_date"].replace(/-/g, "/") + " " + event.attributes["start_time"]),
new Date(event.attributes["end_date"].replace(/-/g, "/") + " " + event.attributes["end_time"])]});
}
}
this.postMessage("collection_out", coll);
};
}, "Upcoming.org XML JSON to Collection");
No comments yet.
>
Wiki Pages
- AboutEform
- AdvancedExamples
- AlertInfotron
- AtomicConstructor
- BulletList
- ButtonInfotron
- ConstructorInfotron
- ContactTheMaintainers
- Dataflow Design Patterns
- DataflowDesignPatterns
- Demo43
- DemoButton
- DemoClock
- DemoEvDb
- DemoForm
- demoHierarchicalEncapsulation
- demoHttp
- DemoMap
- DemoMultiMap
- demoPhotobucketAndWebshot
- demoRssFeeds
- demoRssFeedsTimeline
- DemoSlideShow
- DemoStickyNote
- DemosWalkThrough
- demoYahooSearch
- EformMapperInfotron
- EformRouterInfotron
- EformWrapperInfotron
- EvolutionOfJDA
- FeedMagickInfotron
- FormInfotron
- FourPortRouterInfotron
- GettingStarted
- HowJdaWorks
- HtmlBlueprintSpec
- HtmlInfotron
- HtmlPagerInfotron
- HttpProxyInfotron
- IDA
- ImageInfotron
- InfotronDoc
- JDA Propaganda
- JdaCapabilities
- JdaIncapabilities
- JdaQuotes
- JdaResources
- JdaUsage
- JohnResigJsonRssToCollection
- JsBlueprintSpec
- JsonCallbackInfotron
- JsonXmlFilter
- JsStarDoc
- ListRouterInfotron
- OptionSelectorInfotron
- PasteboardInfotron
- PatternsForLoadingDependencies
- ScratchPad
- SendMessageInfotron
- SendMessagesInfotron
- SequenceMatcherInfotron
- SimpleGoogleMapInfotron
- SimpleYahooMapInfotron
- SlideShowInfotron
- SnifferInfotron
- StaticCalendarInfotron
- StickNotesInfotron
- TabularListingInfotron
- TextInfotron
- TextScrapListerInfotron
- TimeLineInfotron
- TimerInfotron
- Troubleshoot
- TwoStringJoinerInfotron
- UnofficialBlueprints
- UpcoingOrgInfotron
- XmlToEformInfotron
- YahooJsonInfotron
Space Home