Skip to content

Instantly share code, notes, and snippets.

@zobalogh
Created October 3, 2014 13:13
Show Gist options
  • Save zobalogh/c778894ae0808a056bf5 to your computer and use it in GitHub Desktop.
Save zobalogh/c778894ae0808a056bf5 to your computer and use it in GitHub Desktop.
Back up my Instagram photos to Flickr and Dropbox flow
[{"id":"309305f0.cf6cfa","type":"inject","name":"TriggerInstagramCheck","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"x":187,"y":317,"z":"accb4471.5334b8","wires":[["a0deb9f4.5f2148"]]},{"id":"ff6b7b54.009488","type":"function","name":"FileNameGenerator","func":"// initialise the counter to 0 if it doesn't exist already\ncontext.count = context.count || 0; \n\nmsg.filename = \"insta_\" + context.count + \".jpeg\";\ncontext.count += 1;\nreturn msg;","outputs":1,"x":657,"y":317,"z":"accb4471.5334b8","wires":[["84af83a8.7b508","f4df3228.0b20d"]]},{"id":"a0deb9f4.5f2148","type":"instagram","instagram":"","inputType":"photo","outputType":"file","name":"Instagram","x":428,"y":317,"z":"accb4471.5334b8","wires":[["ff6b7b54.009488","b27707f5.4d88f8"]]},{"id":"b27707f5.4d88f8","type":"flickr out","flickr":"","privacy":"fa","tags":"instagram","name":"Back up Photos to Flickr","x":603,"y":148,"z":"accb4471.5334b8","wires":[]},{"id":"84af83a8.7b508","type":"dropbox out","dropbox":"","filename":"","localFilename":"","name":"Back up Photos to Dropbox","x":853,"y":424,"z":"accb4471.5334b8","wires":[]},{"id":"445c473b.bba3b8","type":"file","name":"Back up Photos on local disk","filename":"","appendNewline":false,"overwriteFile":true,"x":1004,"y":67,"z":"accb4471.5334b8","wires":[]},{"id":"f4df3228.0b20d","type":"function","name":"TweakFilePathForDisk","func":"msg.filename = \"/tmp/\" + msg.filename;\nreturn msg;","outputs":1,"x":840,"y":186,"z":"accb4471.5334b8","wires":[["445c473b.bba3b8"]]},{"id":"1e6cfa96.e19305","type":"comment","name":"This flow backs up all new Instagram image posts of the user to Flickr, Dropbox and a local disk","info":"","x":375,"y":54,"z":"accb4471.5334b8","wires":[]},{"id":"424bb01f.bdb45","type":"comment","name":"Need to generate unique filenames for each image","info":"","x":971,"y":314,"z":"accb4471.5334b8","wires":[]},{"id":"ddc57a12.223a88","type":"comment","name":"Flickr doesn't need a file name","info":"","x":346,"y":237,"z":"accb4471.5334b8","wires":[]},{"id":"6e6054bc.919fac","type":"comment","name":"Check future versions of the Instagram node as it might contain useful fields (such as ID, tags, etc.) for file name generation","info":"","x":460,"y":514,"z":"accb4471.5334b8","wires":[]},{"id":"abeae1de.54152","type":"comment","name":"Actually saved under /tmp => NOT backup, it's a demo","info":"","x":953,"y":24,"z":"accb4471.5334b8","wires":[]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment