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: 2009/09/01 15:43 by cssx
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki