Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dougmolineux's full-sized avatar

Doug Molineux dougmolineux

View GitHub Profile
@dougmolineux
dougmolineux / 0_reuse_code.js
Created July 30, 2017 17:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dougmolineux
dougmolineux / getSportsData.js
Created February 7, 2016 03:22
Get BBC XML feed and parse it into an object in Node.js
var url = 'http://feeds.bbci.co.uk/sport/0/football/rss.xml?edition=uk#';
var xml2js = require('xml2js');
var parser = new xml2js.Parser();
var request = require('request');
var colors = require('colors');
// structure of newsItem
// { title: [ 'Can Leicester handle title pressure?' ],
// description: [ 'Leicester have gone from rank outsiders to title favourites after beating Manchester City - can they cope with the expectation?' ],
// link: [ 'http://www.bbc.co.uk/sport/0/football/35514306' ],