🌱 Basic Google script to pull OpenAI RSS updates

Googlescript in Google Sheets

function fetchOpenAIChangelog() {

Β  const feedUrl = "https://openai.com/blog/rss.xml";
Β  const sheetName = "OpenAI Feed";
Β  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);
Β  const response = UrlFetchApp.fetch(feedUrl);
Β  const xml = response.getContentText();
Β  const document = XmlService.parse(xml);
Β  const items = document.getRootElement()
Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  .getChild("channel")
Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  .getChildren("item");
Β  const newRows = [];

Β  for (let i = 0; i < items.length; i++) {
Β  Β  const item = items[i];
Β  Β  const title = item.getChildText("title");
Β  Β  const link = item.getChildText("link");
Β  Β  const pubDate = new Date(item.getChildText("pubDate"));
Β  Β  const description = item.getChildText("description");

Β  Β  // Check if this link already exists in the sheet
Β  Β  const existingLinks = sheet.getRange("D2:D" + sheet.getLastRow()).getValues().flat();
Β  Β  if (existingLinks.includes(link)) continue;
Β  Β  newRows.push([pubDate, "OpenAI", title, link, description]);
Β  }
Β  if (newRows.length > 0) {
Β  Β  sheet.getRange(sheet.getLastRow() + 1, 1, newRows.length, 5).setValues(newRows);
Β  }
}