Giter Club home page Giter Club logo

grepurls's Introduction

GrepURLs / UGrep

This is a simple C++ program that reads its input extracts URLs from it and prints those URLs to stdout. URLs conforming to the RFC 3986 should be parsed successfully. URLs that are delimited by various characters such as (), <>, {}, [], "", '' are also supported.

Build Status

Installation

Just fetch and run Make:

git clone --recursive https://github.com/divyekapoor/grepurls.git
cd grepurls
./configure && make && sudo make install

by default, we install to /usr/local/bin/. If you'd like to install to another path, just edit the Makefile.

Note: The binary is installed as "grepurls" and "ugrep". You may use either one as per your convenience.

If you like, you can also download a pre-built binary from the Releases page.

Usage

ugrep input.html input1.txt input2.txt
cat /tmp/input.html /tmp/input1.txt /tmp/input2.txt | ugrep

OR

grepurls input.html input1.txt input2.txt
cat /tmp/input.html /tmp/input1.txt /tmp/input2.txt | grepurls

You can use standard shell expansion to run ugrep over entire directories:

ugrep mirrored_website/*.html

The URLs will be output 1 per line.

Here's an example:

$ ugrep testdata/contrib_uri.txt
http://de.wikipedia.org/wiki/Uniform_Resource_Identifier
ftp://ftp.is.co.za/rfc/rfc1808.txt
file:///C:/Users/Benutzer/Desktop/Uniform%20Resource%20Identifier.html
file:///etc/fstab
geo:48.33,14.122;u=22.5
ldap://[2001:db8::7]/c=GB?objectClass?one
gopher://gopher.floodgap.com
mailto:[email protected]
sip:[email protected]
news:comp.infosystems.www.servers.unix
data:text/plain;charset=iso-8859-7,%be%fa%be
tel:+1-816-555-1212
telnet://192.0.2.16:80/
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
git://github.com/rails/rails.git
crid://broadcaster.com/movies/BestActionMovieEver
http://nobody:[email protected]:8080/cgi-bin/script.php?action=submit&pageid=86392001#section_2

Uninstall

sudo make uninstall

grepurls's People

Contributors

divyekapoor avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.