qf is a Ruby gem that extracts specific substrings from a block of text.
qf is a productivity tool, it behaves like a standard Unix application and can be chained with other Unix commands.
It helps you extract:
- Emails
- URLs
- Magnet Links
- IPv4 & IPv6 Addressses
- Credit Card Numbers
.. and much more from any stream with flexibility and convenience.
Add this line to your application's Gemfile:
gem 'qf'
And then execute:
$ bundle
Or install it yourself as:
$ gem install qf
qf behaves like a standard Unix application.
Let's say you want to extract URLs from a website:
curl kerembozdas.com | qf url
Emails from some contact page:
curl linux.com/contact | qf email
Or extract and save credit card numbers from a csv file:
cat customers.csv | qf creditcard > customer_ccn.txt
To see all the options you can use:
qf --list
Usage: qf [filter]
Options
-h, --help Prints this help page
-l, --list Lists available filters
Examples
qf url
qf magnet
qf creditcard
qf ipv4
This application uses standard input and output.
- Fork it (https://github.com/krmbzds/qf/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Hint: You can add new rules to the rules.rb
file.
qf (pronounced as /kjuː eff/) is short for quick fetch, or quick find.
However, similar to how people pronounce SQL as sequel, the author likes to pronounce qf as queef.
The MIT License (MIT)
Copyright (c) 2016 Kerem Bozdas