Created
July 11, 2023 00:22
-
-
Save hboon/bea96acb8dd31cf0f45cfd0ae444774f to your computer and use it in GitHub Desktop.
Revisions
-
hboon created this gist
Jul 11, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/usr/bin/env ruby #Opens URLs embedded in STDIN (so it's useful in vim by selecting text and running it) require 'uri' input = $stdin.read.split("\n") urls = input.map do |line| URI.extract(line, ['http', 'https']) end.flatten urls.each do |each| `open #{each}` end