Created
April 3, 2019 21:59
-
-
Save bomberstudios/7285386fa10b4fa9aaa41222bfbbbb55 to your computer and use it in GitHub Desktop.
Install multiple RSS Libraries at once
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install multiple RSS Libraries at once | |
var Library = require('sketch/dom').Library | |
var UI = require('sketch').UI | |
var feeds = [ | |
'https://foobar.com/feed1.xml', | |
'https://foobar.com/feed2.xml', | |
'https://foobar.com/feed3.xml' | |
] | |
feeds.forEach(rss => { | |
var lib = Library.getRemoteLibraryWithRSS(rss, (err, library) => { | |
if (err) { | |
// oh no, failed to load the library | |
} else { | |
UI.message(`${library.name} installed`) | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment