Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Loading GitHub Gists After Page Content Has Loaded</title> | |
| <style type="text/css"> | |
| .gist, | |
| pre { | |
| font-size: 12px ; |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
This gist is based on this one.
// longest-request.js
var casper = require("casper").create();
var utils = require("utils");
var url = casper.cli.get(0);
var times = [];| if (!Date.prototype.toISOString) { | |
| Date.prototype.toISOString = function () { | |
| function pad(n) { return n < 10 ? '0' + n : n; } | |
| function ms(n) { return n < 10 ? '00'+ n : n < 100 ? '0' + n : n } | |
| return this.getFullYear() + '-' + | |
| pad(this.getMonth() + 1) + '-' + | |
| pad(this.getDate()) + 'T' + | |
| pad(this.getHours()) + ':' + | |
| pad(this.getMinutes()) + ':' + | |
| pad(this.getSeconds()) + '.' + |
| // `Object.make(..)` is a helper/wrapper for `Object.create(..)`. Both create a new | |
| // object, and optionally link that new object's `[[Prototype]]` chain to another object. | |
| // | |
| // But `Object.make(..)` makes sure the new object always has a `__proto__` property | |
| // (even a null one) and delegation to a `isPrototypeOf(..)` method, both of which are | |
| // missing from the bare object (aka "Dictionary") created by `Object.create(null)`. | |
| // | |
| // `isPrototypeOf()` is put on a extra object that your created object can delegate to, | |
| // if any only if you create an empty object (by not passing a `linkTo`) that otherwise | |
| // wouldn't have access to `isPrototypeOf()`. |
| @import "compass/css3/images"; | |
| // CSS-only multi-line ellipsis with generated content | |
| // yields `position:relative`, so remember to declare an eventual `position:absolute/fixed` *after* including this mixin | |
| @mixin limitLines( | |
| $maxLinesPortrait, // Mandatory: The number of lines after which the clipping should take action. | |
| $maxLinesLandscape: $maxLinesPortrait, // You may provide a different line limit for landscape orientation. | |
| // Note that 'portrait' is our default orientation. However, if you omit $maxLinesLandscape, | |
| // the value of $maxLinesPortrait is used for whatever orientation (that is, without a media query). |
| var request = require('request'); | |
| var unzip = require('unzip'); | |
| var csv2 = require('csv2'); | |
| request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip') | |
| .pipe(unzip.Parse()) | |
| .on('entry', function (entry) { | |
| entry.pipe(csv2()).on('data', console.log); | |
| }) | |
| ; |
| var page = require('webpage').create(), | |
| address, output, size; | |
| page.onConsoleMessage = function(msg, lineNum, sourceId) { | |
| console.log('CONSOLE: ' + msg); | |
| }; | |
| if (phantom.args.length < 2 || phantom.args.length > 6) { | |
| console.log('Usage: rasterize.js URL filename WxH retina ua'); | |
| phantom.exit(); |