Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (35 sloc) 1.07 KB
#!/usr/bin/env ruby --disable-gems
omphalos = File.expand_path("~/src/omphalos")
binary = File.expand_path("~/src/omphalos/target/debug/omphalos")
# 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}")
end
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..1.0)
open_url(urls.first)
end
You can’t perform that action at this time.