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
/* CSS Photo Album */ | |
/* Rebound of this shot by @daryl: http://drbl.in/fwwM */ | |
* { | |
margin: 0; | |
padding: 0; | |
position: relative; | |
box-sizing: border-box; | |
} |
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
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body ng-controller="MyCtrl"> | |
{{serviceOutput}} | |
<br/><br/> |
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
#!/usr/bin/mongo --quiet | |
//Load data | |
print("Loading data..\n"); | |
load('data.js'); //The file from Firebase | |
//Connect to MongoDB | |
var db = connect("localhost:27017/MyDatabase"); | |
//Add collections |
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
const scrapeIt = require('scrape-it'); | |
const CDP = require('chrome-remote-interface'); | |
const co = require('co'); | |
const json2csv = require('json2csv'); | |
const fs = require('fs'); |
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 getPageContents(url) { | |
return new Promise((resolve, reject) => { | |
CDP((client) => { | |
const {Page, Runtime} = client; | |
// Evaluate outerHTML after page has loaded | |
Page.loadEventFired(() => { | |
setTimeout(() => { | |
Runtime.evaluate({expression: 'document.body.outerHTML'}).then((result) => { |
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 getTopicLinks(html) { | |
let result = scrapeIt.scrapeHTML(html, { | |
topics: { | |
listItem: '.subtags .subtag', | |
data: { | |
link: {attr: 'href'} | |
} | |
} | |
}); |
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
getPageContents('http://www.scripted.com/freelance-writers/software-and-technology?fullApp=true') | |
.then(html => { | |
return Promise.resolve(getTopicLinks(html)); | |
}) | |
.then(result => { | |
console.log(result) | |
}) |
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 exportCSV(profiles) { | |
return new Promise((resolve, reject) => { | |
const fields = [ | |
'name', | |
'profileUrl' | |
]; | |
let csv = json2csv({ data: profiles, fields }); | |
fs.writeFile('profiles.csv', csv, function(err) { | |
if (err) { |
OlderNewer