File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ 
3+ #  @raycast.author Ronan Rodrigo Nunes
4+ #  @raycast.authorURL https://ronanrodrigo.dev
5+ #  @raycast.packageName Browsing
6+ #  @raycast.schemaVersion 1
7+ #  @raycast.title Go to Outline
8+ #  @raycast.description Open the website at Outline
9+ #  @raycast.mode compact
10+ #  @raycast.argument1 { "type": "text", "placeholder": "URL" }
11+ #  @raycast.icon images/outline.png
12+ 
13+ address=$1 
14+ 
15+ if  !  command  -v jq & >  /dev/null;  then 
16+     echo  " Please, install jq: brew install jq" 
17+     exit  1
18+ fi 
19+ 
20+ regex=' (https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' 
21+ if  !  [[ $address  =~  $regex  ]] ;  then 
22+   echo  " Invalid URL" 
23+   exit  1
24+ fi 
25+ 
26+ function  outline_request()  {
27+     curl -s " https://api.outline.com/v3/parse_article?source_url=${address} "  \
28+          -H ' User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0'  \
29+          -H ' Accept: */*'  \
30+          -H ' Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3'   --compressed\
31+          -H ' Origin: https://outline.com'  \
32+          -H ' DNT: 1'   -H ' Connection: keep-alive'  \
33+          -H ' Referer: https://outline.com/'  \
34+          -H ' Sec-GPC: 1' 
35+ }
36+ short_code=$( outline_request |  jq -r ' .data.short_code' ) 
37+ open " https://outline.com/${short_code} " 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments