User Tools

Site Tools


extract.sh

Extract URIs from webpage

Description

This script extracts all URLs/URIs from the homepage you are currently on and displays them in a new instance of uzbl.

Source

#!/bin/zsh

url=$1
jar=$XDG_DATA_HOME/uzbl/data/cookies
uag="Firefox"

temp=$(mktemp)

wget --quiet --user-agent=$uag --load-cookies=$jar $url -O - | \
    grep -Eo "<a[^>]*href=\"([^\"]*)\"[^>]*>" | \
    sed -e 's/<a[^>]*href="//g' -e 's/"[^>]*>//g' >| $temp 

uzbl "file://$temp" &

Installation

Add something like this to your uzbl config:

bind e = sh "$XDG_DATA_HOME/uzbl/scripts/extract.sh $6 &"
extract.sh.txt · Last modified: 2016/08/31 14:10 (external edit)