Skip to content

Instantly share code, notes, and snippets.

@Radvendii
Created June 29, 2017 03:12
Show Gist options
  • Save Radvendii/10b5f434544a7bb35affc01646985716 to your computer and use it in GitHub Desktop.
Save Radvendii/10b5f434544a7bb35affc01646985716 to your computer and use it in GitHub Desktop.
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
var html = process.argv[2];
var dom = new JSDOM(html);
var ary = dom.window.document.getElementsByTagName("a");
if(ary.length >= 1)
console.log(ary[0].getAttribute("href"));
#!/usr/bin/env bash
href=$(node /path/to/grabhref.js "$QUTE_SELECTED_HTML")
echo $href
echo "jseval window.location.href = '$href'" >> "$QUTE_FIFO"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment