zusatzstoff Posted June 28, 2015 Share Posted June 28, 2015 (edited) Hey guys, I've created my very first workflow based on the NodeJS framework provided by @tungdang (http://www.alfredforum.com/topic/5488-alfred-workflow-nodejs/). It's a very simple german-english dictionary based on linguee.de. It features autocompletion, auto detection of the input language (german or english) and phrases. Installed NodeJS is a precondition Download link, description and source can be found here: https://github.com/zusatzstoff/linguee-alfred-workflow Feedback for improvement is appreciated Edited July 24, 2016 by zusatzstoff bivalvegruff 1 Link to comment
zusatzstoff Posted July 24, 2016 Author Share Posted July 24, 2016 I released a new version of this workflow written in golang. You don't need NodeJS anymore as a precondition. deanishe 1 Link to comment
deanishe Posted July 25, 2016 Share Posted July 25, 2016 Very nice. And so fast. I will be using this a lot! I have one request: Seeing as the workflow's results all have a specific translation direction, could the results open the webpage for the right translation direction as well, instead of the generic EN <-> DE results (i.e. set source=deutsch or source=englisch instead of source=auto)? For example, say I type a query with matches in both directions: If I action the first result, which is DE -> EN, I would like to see DE -> EN results. Currently, the workflow always opens the bidirectional DE <-> EN results page, which means I get all the irrelevant EN -> DE results first and the EN -> DE examples instead of the DE -> EN ones I'm looking for.Would that be possible? Link to comment
deanishe Posted July 25, 2016 Share Posted July 25, 2016 I have another request! Any chance to make the entered query one of the results? For example, I tried to look up "vergeigen" and "BetrVG". The workflow (and Linguee's search box) provide no suggestions, but there are results for the terms if you actually hit Search. Link to comment
zusatzstoff Posted July 25, 2016 Author Share Posted July 25, 2016 Hey, for the first request I will have a look if the suggestion document gives me some kind of a language tag back. If that's the case a directional translation page will be manageable. The second one shouldn't be a problem at all Will try to keep you posted here what's the progress on this is. deanishe 1 Link to comment
deanishe Posted July 25, 2016 Share Posted July 25, 2016 Great! I've had a quick look at the HTML, and each item is tagged with the language in several places. Indeed, the URL in div.main_item[href] points to the "right" page: <div class='main_item' lid='DE:Lager22603' lc='DE' href='/deutsch-englisch/uebersetzung/Lager.html'>Lager</div> and <div class='main_item' lid='EN:lager55558' lc='EN' href='/englisch-deutsch/uebersetzung/lager.html'>lager</div> Link to comment
deanishe Posted July 25, 2016 Share Posted July 25, 2016 Found a wee bug. Alfred doesn't have an "Escape Single Quotes" option, so you can't use single quotes around {query} in the Script Box in the line below or the workflow dies in flames on a query with a single quote in it, like "can't". ./linguee "$(iconv -f UTF8-MAC <<<'{query}' )" You have to use double quotes instead: ./linguee "$(iconv -f UTF8-MAC <<<"{query}" )" with Escaping Options Backquotes, Double Quotes, Backslashes and Dollars. Sorry I'm piling all these requests and stuff on you. I just know I'm going to use the ever-loving shit out of this workflow. Link to comment
zusatzstoff Posted July 25, 2016 Author Share Posted July 25, 2016 Haha no problem, I really appreciate the suggestions Thanks for the bug report, that's something I will immediately fix. Link to comment
zusatzstoff Posted July 25, 2016 Author Share Posted July 25, 2016 That was easier than expected, I added the features to the workflow Please give me feedback if it works as expected. deanishe 1 Link to comment
deanishe Posted July 25, 2016 Share Posted July 25, 2016 (edited) Wonderbra! Works perfectly. I noticed another small issue when upgrading: You should probably assign a Bundle ID in the main workflow configuration screen. Without a Bundle ID, Alfred can't tell the version I just downloaded is an update of an already installed workflow, so it installed a second version alongside the first instead. FWIW, technically you need to select Backslashes and Backquotes for the Escaping to be correct, but I don't imagine anyone will enter either of those as a query for this workflow. Edited July 25, 2016 by deanishe Link to comment
zusatzstoff Posted July 25, 2016 Author Share Posted July 25, 2016 Nice insights. Added the bundle ID. The Backslashes and Backquotes seems to be a problem with passing it via cli to the binary, any ideas how to fix this? Link to comment
deanishe Posted July 25, 2016 Share Posted July 25, 2016 You might have got the options a bit wrong. This works (though the results are nonsense): Link to comment
zusatzstoff Posted July 25, 2016 Author Share Posted July 25, 2016 Ok added the parameters. Seems that the linguee API isn't that smart with special characters Link to comment
Acidham Posted October 5, 2017 Share Posted October 5, 2017 Is golang required to run the workflow? I tried it but I get no results but [ERROR: input.scriptfilter] Code 11: Exited with error code but no message Link to comment
deanishe Posted October 5, 2017 Share Posted October 5, 2017 12 minutes ago, Acidham said: Is golang required to run the workflow? Nope. It's statically compiled. Link to comment
Acidham Posted October 5, 2017 Share Posted October 5, 2017 hmm, any idea on what I did wrong or why I am receiving instantly this error? Link to comment
deanishe Posted October 5, 2017 Share Posted October 5, 2017 Not really: it's working fine for me. Were you using it a lot? It's possible they blocked you… Link to comment
Acidham Posted October 5, 2017 Share Posted October 5, 2017 No just 2-6 times. Is an API key required or something? Link to comment
deanishe Posted October 5, 2017 Share Posted October 5, 2017 No. There is no API. The workflow scrapes the HTML from the search suggestion endpoint. Link to comment
Acidham Posted October 6, 2017 Share Posted October 6, 2017 Seems its related to High Sierra ... There is an issue open on git... Link to comment
Easytiger Posted October 6, 2017 Share Posted October 6, 2017 (edited) I also have the problem after I upgraded to High Sierra. This is unfortunate at Leo also doesn't work anymore. No good dictionary makes work difficult. [ERROR: input.scriptfilter] Code 11: Exited with error code but no message Edited October 6, 2017 by Easytiger Crackz 1 Link to comment
deanishe Posted October 6, 2017 Share Posted October 6, 2017 7 hours ago, Acidham said: Seems its related to High Sierra ... That would explain why it still works for me. It's possible that the workflow just needs recompiling. Link to comment
Easytiger Posted October 6, 2017 Share Posted October 6, 2017 8 hours ago, Acidham said: Seems its related to High Sierra ... There is an issue open on git... That would be great. After Leo.org is no longer working this is urgently needed. Crackz 1 Link to comment
Crackz Posted October 8, 2017 Share Posted October 8, 2017 Update is posted on Git. Works again. Thank you! ?https://github.com/alexander-heimbuch/linguee-alfred-workflow 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