Jump to content

Wikipedia Auto Complete Workflow (Python)


Recommended Posts

Attached is a simple Wikipedia auto complete workflow.

jW1xc.png

-Download: http://d.pr/f/no3O

 
For those like myself who prefer scripting in Python, the following class makes generating feedback easy

-View/Download: http://d.pr/f/GMO8

 

Example Usage:

from alfred import Feedback
fb = Feedback()
fb.add_item("Hello World", subtitle="Simple Greeting")
fb.add_item("Foo", subtitle="Bar", icon="foobar.icon", arg="foobar")
print fb

 

Enjoy

Link to post

Very nice, thanks!

 

I added another Open URL action and set the it to open articles in my native language, Danish. Then, I added this as another action for the script filter and assigned a modifier key to it so I can choose to open the article in English or Danish. Just though I would share this "tip".

Link to post
Very nice, thanks!

 

I added another Open URL action and set the it to open articles in my native language, Danish. Then, I added this as another action for the script filter and assigned a modifier key to it so I can choose to open the article in English or Danish. Just though I would share this "tip".

 

 

The problem with this approach is that if the article in your language has a different name it will not work. 

I added a second workflow and modified the python to search the articles in dutch. Both workflows use the same keyword. This will give you results in both languages. The only issue with this approach is that I'm getting 2 dutch results on top, then several english results and afterwards the dutch results continue.

 

Schermafbeelding%202013-01-14%20om%2015.

Link to post
The problem with this approach is that if the article in your language has a different name it will not work. 

I added a second workflow and modified the python to search the articles in dutch. Both workflows use the same keyword. This will give you results in both languages. The only issue with this approach is that I'm getting 2 dutch results on top, then several english results and afterwards the dutch results continue.

 

Schermafbeelding%202013-01-14%20om%2015.

 

That's right. If the articles haven't got the same name, my approach will not work.

 

I have modified your Feedback class a bit to also set the 'valid' and the 'autocomplete' options. I hope that's all right. I have uploaded it here.

Link to post
  • 2 weeks later...
  • 3 weeks later...
  • 4 weeks later...
  • 2 months later...
  • 2 weeks later...

Please post a link to this workflow. I am not interested in the alternative, I don't want to type "w en" as the prefix rather than just "w".

 

Thanks in advance.

 

A bit of a late reply, but it really is excruciatingly easy to change the behaviour of that alternative workflow so that you don't need to type the Wikipedia language code. There are instructions in the first post of the thread and in the script filter itself. Just add your preferred language code to the last line of the filter. For English the line would look like this: python w.py en {query}

Link to post
  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...