Created
April 10, 2020 20:43
-
-
Save matheuschimelli/c2dacbde36df0c2c0f136a05473a88db to your computer and use it in GitHub Desktop.
google app script
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
function traduz(title, fromLang, toLang){ | |
LanguageApp.translate(title, fromLang, toLang); | |
} | |
function g1() { | |
var array = []; | |
var url = 'https://g1.globo.com/rss/g1'; | |
var feed = UrlFetchApp.fetch(url).getContentText(); | |
feed = XmlService.parse(feed); | |
var items = feed.getRootElement().getChild("channel").getChildren("item"); | |
for (var i in items) { | |
var link = items[i].getChild("link").getValue(); | |
// avoid adding duplicates | |
var title = items[i].getChild("title").getValue(); | |
array.push([link, title]); | |
} | |
return array; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment