@@ -0,0 +1,1716 @@
+#  Naver Search Workflow for Alfred 2%0A#  Copyright (C) 2014  Jinuk Baek%0A#  This program is free software; you can redistribute it and/or%0A#  modify it under the terms of the GNU General Public License%0A#  as published by the Free Software Foundation; either version 2%0A#  of the License, or (at your option) any later version.%0A#%0A#  This program is distributed in the hope that it will be useful,%0A#  but WITHOUT ANY WARRANTY; without even the implied warranty of%0A#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A#  GNU General Public License for more details.%0A#%0A#  You should have received a copy of the GNU General Public License%0A#  along with this program; if not, write to the Free Software%0A#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.%0A%0A%0Aimport sys%0A%0Afrom workflow import web, Workflow%0A%0A%0Adef get_dictionary_data(word):%0A%09url = 'http://frdic.naver.com/ac'%0A%09params = dict(st=111, r_lt=111, n_kofrdic=111, q=word)%0A%0A%0A%09r = web.get(url, params)%0A%09r.raise_for_status()%0A%09return r.json()%0A%0A%0Adef main(wf):%0A%09import cgi;%0A%0A%09args = wf.args%5B0%5D%0A%0A%09wf.add_item(title = 'Search Naver Frdic for %5C'%25s%5C'' %25 args, %0A%09%09%09%09autocomplete=args, %0A%09%09%09%09arg=args,%0A%09%09%09%09valid=True)%0A%0A%09def wrapper():%0A%09%09return get_dictionary_data(args)%0A%0A%09res_json = wf.cached_data(%22fr_%25s%22 %25 args, wrapper, max_age=600)%0A%0A%09for item in res_json%5B'items'%5D:%0A%09%09for ltxt in item:%0A%09%09%09if len(ltxt) %3E 0:%0A%09%09%09%09txt = ltxt%5B0%5D%5B0%5D;%0A%09%09%09%09rtxt = cgi.escape(ltxt%5B1%5D%5B0%5D);%0A%0A%09%09%09%09wf.add_item(title = u%22%25s     %25s%22 %25 (txt, rtxt) ,%0A%09%09%09%09%09%09%09subtitle = 'Search Naver Frdic for %5C'%25s%5C'' %25 txt, %0A%09%09%09%09%09%09%09autocomplete=txt, %0A%09%09%09%09%09%09%09arg=txt,%0A%09%09%09%09%09%09%09valid=True);%0A%0A%09wf.send_feedback()%0A%09%09%09%09%0A%0A%0Aif __name__ == '__main__':%0A%09wf = Workflow()%0A%09sys.exit(wf.run(main))%0A%0A%0A

add a french-korean dictionary by Naver