John Posted March 27, 2013 Share Posted March 27, 2013 Hi, ist it possible to set one language as the standard, but optionally use other languages by adding the language code? So, when I type "w {query}" it searches the English Wikipedia, but when I type "w de {query}" it searches the German one? Thanks Link to comment
Benzi Posted March 28, 2013 Author Share Posted March 28, 2013 (edited) Hi, ist it possible to set one language as the standard, but optionally use other languages by adding the language code? So, when I type "w {query}" it searches the English Wikipedia, but when I type "w de {query}" it searches the German one? Thanks One way to do this is to add a hotkey to the workflow. When the hotkey is triggered it is configured so that the text "en " (note the space at the end) is passed on to the search portion (the script filter) of the workflow. Now, we you press the hotkey, you get English search by default. But you can always go back to multi language search using "w <code> ". Here is a modified version (stripped of the hotkey - so you need to set it to your liking) that you can try. Edited March 28, 2013 by Benzi Link to comment
Guest Posted March 28, 2013 Share Posted March 28, 2013 (edited) Thank you Benzi for sharing your Workflow with us. I use your Workflow to search the official RealBasic Wiki and it works like a charm. But i would like to remove all the unnecessary code, because i do not need the multilanguage option. And i can't get suggestions make show up while entering the query. :-( I hope someone can take a look at the code and help me out here. :-) Thank you Here is my RBWiki Workflow: RealBasic Wiki Search.alfredworkflow Edited May 15, 2013 by Guest Link to comment
Benzi Posted March 28, 2013 Author Share Posted March 28, 2013 Thank you Benzi for sharing your Workflow with us. I use your Workflow to search the official RealBasic Wiki and it works like a charm. But i would like to remove all the unnecessary code, because i do not need the multilanguage option. And i can't get suggestions make show up while entering the query. :-( I hope someone can take a look at the code and help me out here. :-) Thank you Here is my RBWiki Workflow: https://dl.dropbox.com/u/9575378/RealBasic%20Wiki%20Search.alfredworkflow Hi thanks! one small suggestion - try posting your query in the Workflow Help and Questions section of this forum - it would probably gain more traction there rather than here; more people viewing your post will increase your chances of getting help. Link to comment
pi1ot Posted April 1, 2013 Share Posted April 1, 2013 (edited) there is a bug search by chinese: and the wikipedia api response is ok: http://zh.wikipedia.org/w/api.php?action=query&list=search&srprop=timestamp&format=json&srsearch=朱棣 i'm not familar with python, don't know how to fix it. Edited April 1, 2013 by pi1ot Link to comment
Benzi Posted April 1, 2013 Author Share Posted April 1, 2013 there is a bug search by chinese: and the wikipedia api response is ok: http://zh.wikipedia.org/w/api.php?action=query&list=search&srprop=timestamp&format=json&srsearch=朱棣 .... i'm not familar with python, don't know how to fix it. Hi, can you try re-downloading the workflow again? I made a small change and am hoping that will resolve the problem. Download link. (all download links point to the latest version) Link to comment
pi1ot Posted April 1, 2013 Share Posted April 1, 2013 Hi, can you try re-downloading the workflow again? I made a small change and am hoping that will resolve the problem. Download link. (all download links point to the latest version) works now, thanks! Link to comment
pacifist Posted April 12, 2013 Share Posted April 12, 2013 Would it be possible to show the first string of text after the title of each wikipedia article as the subtext under each search result? So if I searched for Alfred (software) it would say in the subtext "Alfred is an application launcher and productivity application for Mac OS X..." instead of "read about Alfred (software". Great workflow - thanks! Link to comment
Benzi Posted April 12, 2013 Author Share Posted April 12, 2013 Would it be possible to show the first string of text after the title of each wikipedia article as the subtext under each search result? So if I searched for Alfred (software) it would say in the subtext "Alfred is an application launcher and productivity application for Mac OS X..." instead of "read about Alfred (software". Great workflow - thanks! Its do-able. The latest version does that. Link to comment
kerim Posted April 12, 2013 Share Posted April 12, 2013 I type "w zh 中華民國" and expect to find the Chinese language wikipedia page for Taiwan, instead I am given search results for the English version of the page. Am I doing something wrong? Link to comment
pacifist Posted April 12, 2013 Share Posted April 12, 2013 Its do-able. The latest version does that. Right on! Link to comment
Benzi Posted April 12, 2013 Author Share Posted April 12, 2013 (edited) I type "w zh 中華民國" and expect to find the Chinese language wikipedia page for Taiwan, instead I am given search results for the English version of the page. Am I doing something wrong? If you just downloaded the latest version, I had put in en search on by default. To change that, you need to do the following: Open up Alfred Preferences Locate the Wikipedia ML search workflow and select it Open up the Script Filter box (the one with the Wikipedia logo) by clicking it There will be a text area at the bottom where you need to check the following: The last line should be something like: "python w.py en {query}" - which means that the search will be against the English site. To make it use the Chinese version, you need to change that like to "python w.py {query}" (without en). Now, if you type in Alfred "w zh 中華民國" it should be against the Chinese site. Please let me know if this helps. EDIT in fact, upon re-reading my original post for the workflow, I realized the cause of the confusion. So I have updated the workflow at the download link to work by default in multilanguage search mode. So you can re-download the workflow and use as is... and no need to mess about with the internals Edited April 12, 2013 by Benzi parekh 1 Link to comment
parekh Posted April 13, 2013 Share Posted April 13, 2013 Hi, I just want to report a small bug. I notice that the search term cannot contain an apostrophe. Try searching for any term that includes an apostrophe and it doesn't work. Link to comment
Benzi Posted April 13, 2013 Author Share Posted April 13, 2013 Hi, I just want to report a small bug. I notice that the search term cannot contain an apostrophe. Try searching for any term that includes an apostrophe and it doesn't work. Ah yes... for now, to search with single quotes, use \'. e.g. w en world\'s largest parekh 1 Link to comment
parekh Posted April 16, 2013 Share Posted April 16, 2013 (edited) Ah yes... for now, to search with single quotes, use \'. e.g. w en world\'s largest Thanks for the reply - that works! Edited April 16, 2013 by parekh Link to comment
BarelakedNadies Posted April 19, 2013 Share Posted April 19, 2013 (edited) Love this workflow. I hope you don't mind me asking in here but is there a way to modify this to show band discographies by typing (for instance) "w d [band name]". Obviously this isn't necessarily a feature that everyone wants so I don't mind modifying the workflow myself but I'm fairly amateur at coding so a point in the right direction would be great. Really i'm just looking for a workflow to quickly access discographies but I haven't found one yet. Thanks. Edited April 19, 2013 by BarelakedNadies Link to comment
Benzi Posted April 21, 2013 Author Share Posted April 21, 2013 Love this workflow. I hope you don't mind me asking in here but is there a way to modify this to show band discographies by typing (for instance) "w d [band name]". Obviously this isn't necessarily a feature that everyone wants so I don't mind modifying the workflow myself but I'm fairly amateur at coding so a point in the right direction would be great. Really i'm just looking for a workflow to quickly access discographies but I haven't found one yet. Thanks. I don't think Wikipedia exposes that sort of information in a way that would make it easy to extract discographies alone. The only closest thing I could find in terms a of development friendly API is http://bandcamp.com/developer, but they have stopped providing API keys. In order to get this information from Wikipedia, I suppose you may need to extract the text of the article, parse it with some Media Wiki parser, and get the relevant sections out - although, having looked at a couple of band pages on Wikipedia, there is no set convention on how discographies are listed, some are in tables, some are in plain lists etc... I may be wrong, but Wikipedia might not be the best / easiest place to get this information programatically. Link to comment
avk_tp Posted May 17, 2013 Share Posted May 17, 2013 I'm not sure if it's just me, but this workflow has stopped working for me. I tried reinstalling it but to no avail. Link to comment
bargepole Posted May 29, 2013 Share Posted May 29, 2013 Hello there, I would like a monolingual (English) version of this. I'm not a programmer so I don't understand what file to edit in order to achieve. Please point me in the write direction. As long as you don't make any assumptions, I can follow. Thanks in advance. Link to comment
smirky Posted May 30, 2013 Share Posted May 30, 2013 Love this workflow. I hope you don't mind me asking in here but is there a way to modify this to show band discographies by typing (for instance) "w d [band name]". Obviously this isn't necessarily a feature that everyone wants so I don't mind modifying the workflow myself but I'm fairly amateur at coding so a point in the right direction would be great. Really i'm just looking for a workflow to quickly access discographies but I haven't found one yet. Thanks. At the risk of derailing this thread, have you looked into something like the Discogs.com API, or even Last.fm's? I haven't used the Discogs API before but it looks pretty good, and I'm familiar enough with Last.fm's to say that would work as well. If this is something you want to ask for help about, I would recommend a new thread at this point, though. Link to comment
PjotV Posted October 24, 2013 Share Posted October 24, 2013 This is a great workflow! I am especially happy with the multi-language element. Since I regularly check information on Wikepedia in different languages, this is a great help and timesaver. Thanks! Link to comment
nowasforjason Posted March 3, 2015 Share Posted March 3, 2015 This workflow is brilliant--thank you for programming it! I run an English school in Japan and this workflow is going to save me a ton of time cross-linking posts on social media for my students. Thank you so much. I found this because lately I've been searching online for a workflow like this for the new Workflow app for iOS that launched last December. I don't suppose anyone (or Benzi himself?) has made/knows about such a workflow? Link to comment
rice.shawn Posted March 4, 2015 Share Posted March 4, 2015 I found this because lately I've been searching online for a workflow like this for the new Workflow app for iOS that launched last December. I don't suppose anyone (or Benzi himself?) has made/knows about such a workflow? I just looked up that app, and it seems neat. But the approach to creating something like (from the bit that I read) seems incompatible with most of the work that is done with Alfred workflows. The main reason is that the iOS app seems to need the applications themselves to have either coded in actions or the iOS workflows app provides the actions, and these, for the most part, need to be written and compiled with Objective-C (or Swift) and rely mostly on iOS URI schemes and callbacks to make everything work. Workflows for Alfred are coded with scripting languages (AppleScript, Bash, Perl, PHP, Python, Ruby, Zsh, etc...), which are not available in the same way, if at all, on iOS. So while the functionality might be the same, the approach to implementing them is not cross-compatible, thus not portable. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now