Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 49 lines (43 sloc) 1.3 KB
#!/usr/bin/env ruby --disable-gems
omphalos = File.expand_path("~/src/omphalos")
binary = File.expand_path("~/src/omphalos/target/debug/omphalos")
instapaper_only = ARGV.delete("-i")
# re-hydrate instapaper urls async
system("cd #{omphalos} && nohup #{binary} instapaper_list > \
/tmp/instapaper_urls_$$ && \
mv /tmp/instapaper_urls_$$ /tmp/instapaper_urls &")
urls = []
loop do
begin
urls = File.read("/tmp/instapaper_urls").split("\n").shuffle
break
rescue Errno::ENOENT # first time, file isn't present yet.. wait
sleep 0.05
end
end
def open_url(url)
# firefox_path = "/Applications/Firefox.app/Contents/MacOS/firefox"
# system("#{firefox_path} --new-tab #{url}")
system("open #{url}")
end
if instapaper_only
open_url(urls.first)
else
random = Kernel.rand
case random
when (0.0...0.1)
open_url "https://readwise.io/tags/next"
when (0.1..0.15)
open_url "https://dynalist.io/d/wrc4IfhJ7EzU5yIK6bNz1kYR"
when (0.15...0.2)
open_url "things:///show?query=Zettelkasten to Readwise"
when (0.2...0.25)
open_url "https://memoryleague.com/#!/train"
when (0.25...0.30)
open_url "https://ourworldindata.org/charts"
# when (0.25..0.35)
# open_url "https://www.gjopen.com/questions?filter=following"
when (0.25..1.0)
open_url(urls.first)
end
end