Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "schema_version": 1,
- "name": "PhantomJs Cloud Demo",
- "description": "Example usage with PhantomJs Cloud (https://phantomjscloud.com/).\r\nYou'll need to sign up and get an API key for this to work.",
- "source_url": false,
- "guid": "32329783da28399392645cff5a14ab9f",
- "tag_fg_color": "#ffffff",
- "tag_bg_color": "#5bc0de",
- "exported_at": "2016-05-04T18:56:54Z",
- "agents": [
- {
- "type": "Agents::DataOutputAgent",
- "name": "PhantomJS Cloud - Out - RSS",
- "disabled": false,
- "guid": "37094003a5077e78ec3114a475d2382c",
- "options": {
- "secrets": [
- "phantom"
- ],
- "expected_receive_period_in_days": 2,
- "template": {
- "title": "XKCD comics as a feed",
- "description": "This is a feed of recent XKCD comics, generated by Huginn",
- "item": {
- "title": "{{title}}",
- "description": "{{body}}"
- }
- }
- },
- "keep_events_for": 3600,
- "propagate_immediately": false
- },
- {
- "type": "Agents::WebsiteAgent",
- "name": "PhantomJS Cloud - Process - Fetch Page",
- "disabled": false,
- "guid": "3bc94a9d728abd43439c797518089513",
- "options": {
- "expected_update_period_in_days": "2",
- "url_from_event": "https://PhantomJsCloud.com/api/browser/v2/{%credential phantomjs_cloud%}/?request={{url}}",
- "type": "html",
- "mode": "on_change",
- "extract": {
- "title": {
- "css": "title",
- "value": "normalize-space(.)"
- },
- "body": {
- "css": "body #comic",
- "value": "./node()"
- }
- }
- },
- "schedule": "every_1d",
- "keep_events_for": 3600,
- "propagate_immediately": true
- },
- {
- "type": "Agents::EventFormattingAgent",
- "name": "PhantomJS Cloud - Process - Format",
- "disabled": false,
- "guid": "3d0bed6bac1892bea2f8e440e44c58b8",
- "options": {
- "instructions": {
- "message": {
- "url": "{{url}}",
- "renderType": "html",
- "requestSettings": {
- "userAgent": "Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+"
- }
- }
- },
- "mode": "clean"
- },
- "keep_events_for": 3600,
- "propagate_immediately": true
- },
- {
- "type": "Agents::RssAgent",
- "name": "PhantomJS Cloud - In - RSS",
- "disabled": false,
- "guid": "9feb8ef94dc8f8fe6d4f0c5740abb00d",
- "options": {
- "expected_update_period_in_days": "5",
- "clean": "true",
- "url": "http://xkcd.com/rss.xml"
- },
- "schedule": "every_1d",
- "keep_events_for": 3600
- },
- {
- "type": "Agents::JavaScriptAgent",
- "name": "PhantomJS Cloud - Process - JS Escape",
- "disabled": false,
- "guid": "e22d083a6fa306ac83692095a11221ce",
- "options": {
- "language": "JavaScript",
- "code": "Agent.receive = function() {\r\n var events = this.incomingEvents();\r\n for(var i = 0; i < events.length; i++) {\r\n var js = JSON.stringify(events[i].payload.message);\r\n this.log('Message to escape: ' + js);\r\n this.createEvent({ 'url': encodeURIComponent(js) });\r\n var callCount = this.memory('callCount') || 0;\r\n this.memory('callCount', callCount + 1);\r\n }\r\n}",
- "expected_receive_period_in_days": "2",
- "expected_update_period_in_days": "2"
- },
- "schedule": "never",
- "keep_events_for": 3600,
- "propagate_immediately": true
- }
- ],
- "links": [
- {
- "source": 1,
- "receiver": 0
- },
- {
- "source": 2,
- "receiver": 4
- },
- {
- "source": 3,
- "receiver": 2
- },
- {
- "source": 4,
- "receiver": 1
- }
- ],
- "control_links": [
- ]
- }
Add Comment
Please, Sign In to add comment