summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-12-21 20:13:07 +0000
committerMatthew Lemon <y@yulqen.org>2023-12-21 20:13:07 +0000
commitfc6852b23cbffeebaf35c9676c76055cc49917d3 (patch)
tree85ed10fad2d673c787a0cb5ed9a81b4f5ce23f7b
parente512c58cbd5373dc17b4cb65671a7aa38afa3240 (diff)
Finishing touches...
-rwxr-xr-x[-rw-r--r--]main.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.rb b/main.rb
index 9ef710f..c133181 100644..100755
--- a/main.rb
+++ b/main.rb
@@ -1,3 +1,5 @@
+#!/bin/env ruby
+
require 'nokogiri'
require 'open-uri'
require 'getoptlong'
@@ -10,13 +12,15 @@ opts = GetoptLong.new(
[ '--comment', '-c', GetoptLong::OPTIONAL_ARGUMENT ]
)
+QUICKNOTE_PATH = '/home/lemon/Documents/Notes/quicknote.md'
+
comment = nil
opts.each do |opt, arg|
case opt
when '--help'
puts <<-EOF
- quicknote grabs whatever URL you give it, parses out the title of the web page, and save it somewhere nice.
+ quicknote grabs whatever URL you have in the clipboard, parses out the title of the web page, and save it somewhere nice.
That is all.
EOF
@@ -42,7 +46,7 @@ URI.open(url) do |f|
title_out = title
end
-open('/tmp/toss.txt', 'a') do |f|
+open(QUICKNOTE_PATH, 'a') do |f|
if comment
f << "#{comment}: [#{title_out}](#{url})" + "\n"
else