Skip to content

Instantly share code, notes, and snippets.

@CorentinDy
Created May 30, 2017 07:02
Show Gist options
  • Save CorentinDy/2634e6b8070b5a444fcaaa43ed57a0d9 to your computer and use it in GitHub Desktop.
Save CorentinDy/2634e6b8070b5a444fcaaa43ed57a0d9 to your computer and use it in GitHub Desktop.
Js to grab last update from meltdown's planning
const scrapeIt = require("scrape-it");
// use it with a city argument like "Toulouse" -> $ node rss.js Toulouse
var city = process.argv[2];
if(city){
scrapeIt("https://www.meltdown.bar/"+city+"/planning", {
// Fetch the planning content
items: {
listItem : ".left-row"
,data : {
date: {
selector: ".date"
},
title: {
selector: ".right-text > h3"
},
description:{
selector: ".event-desc"
}
}
}
}, (err, page) => {
console.log(err || page);
});
} else {
console.log('No city selected.');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment