Jump to content
Sign in to follow this  
phstc

What's the easiest way to show and filter a list of urls?

Recommended Posts

Hello

 

I have some links which I use daily (they aren't in my Chrome bookmarks):

 

  1. Admin - http://
  2. Production - http://
  3. Log - http://
  4. Hangout - http://
  5. ...

I would like to create a workflow i.e. "links" to show these links and filter them as I type, if I click in the link it should open the url in Chrome.

 

I didn't find a similar example, all of them seemed too complex for what I want. Is there a simple way to create such workflow?

 

Thanks

Edited by phstc

Share this post


Link to post

Create a new workflow. There's a template for opening a URL in a browser. Set a keyword, e.g., admin, and fill in the URL. Then add the same two blocks over and over again for each keyword and each URL. At the end you'll have a complete workflow with all of your keywords and URLs.

Share this post


Link to post

Yes, but you'll have to write code. Create a workflow. Use a script filter and write code that lists the URLs and displays only the ones that match the query.

Share this post


Link to post

Right, I ended up with a script.

 

 

https://github.com/phstc/alfred_links_workflow

 

 

LINKS = {
  'Pablo'  =>   'http://pablocantero.com',
  'GitHub' =>   'http://github.com/phstc'
}


query = '{query}'.strip.downcase


if query == ''
  selected = LINKS
else
  selected = LINKS.reject do |name, link|
    name.to_s.downcase.index(query).nil?
  end
end


output = %{<?xml version="1.0"?><items>}


selected.each do |name, link|
  output += %{
  <item uid="#{name}" arg="#{link}" autocomplete="#{name}">
    <title>#{name}</title>
  <icon>link.png</icon>
  </item>
  }
end


output += "</items>"


puts output

 

Edited by phstc

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  
×
×
  • Create New...