Jump to content

bikeNik

Member
  • Posts

    47
  • Joined

  • Last visited

Everything posted by bikeNik

  1. strange, I can't understand. I tried asynchronous Javascript functions - async/await in my IDE (VS Code) debug mode. In one file. And I get result asynchronously as I expect. i.e. { "items": [ { "title": "Current time is:", "subtitle": " 10:44:35 ", "icon": { "path": "./time-icon.png" }, "arg": " 10:44:35 " } ] } I get immediately this result in output in my IDE, as expected. And background process (writing JSON file) continues to work. But Alfred showing this result only after All function executed. Why it's happened? Is it real to invoke two processes (with Alfred's outputting of his items as first immediately process) asynchronously - in other languages, in bash for example?
  2. ./node_modules/.bin/run-node index.js "$1" & ./node_modules/.bin/run-node update-concurrently.js "get time" ./node_modules/.bin/run-node update-concurrently.js "get time" & ./node_modules/.bin/run-node index.js "$1" all these variants that I tried above are returned with a delay in 5 seconds. i.e I get this result and only after 5 seconds I get this: 5 seconds in this workflow example is as the imitation of request latency. Expected that the result with (old) data of time must be is immediate. but the refreshed data of time executed (5 sec) in the background process will be showing in the next time when I invoke this workflow.
  3. @vitor Doesn't work as I expect: I get two commands instead of one and launch the second script only by the second command. In this case, (if I understood correctly) first script (showing time) will be executed after the 5 seconds, that is, after the second script.
  4. I made another workflow. disk.yandex.ru (19mb) This workflow generates (in 5 seconds! as the imitation of network request) JSON file with current time data. In the format like - [HR:MIN:SEC]. With the keyword: "concurrently" I launch [Script Filter] which launchings the "index.js" and I expect to receive the data of time in "subtitle". But the file which should be generated with this data of time launchings (concurrently) by the [Run Script] block. in the file "update-concurrently.js" only after the hit [enter] Thus I expected to refresh data of time after the [keyword] "concurrently" command. Without [enter]. Is this possible? So in other words: I want to refresh JSON file by the [keyword]: 'concurrently' - concurrently with the main process of this workflow. For testing Requires - Node.js p.s. Sorry for my English and for this word - "concurrently" which has been written so many times 😃
  5. @vitor I'll try to work something out with your suggestions - many thanks. I think this workflow is too complicated for testing this feature at this moment. Requires: Node.js 7.6+ and Anki intelligent flashcards. I'll reproduce it with another workflow. Thnx again!
  6. Hello, Alfred's community! I can't solve the following problem: My workflow in NodeJS environment. I've got two files. And I run them. 1. index.js for launching my processes ( [script filter] with "titles, subtitles" on the output) ./node_modules/.bin/run-node index.js "$1" "headword" and 2. refresh.js for refreshing JSON data ([Run Script] background process) ./node_modules/.bin/run-node src/cmd/refresh.js "#runref" I'm launching (concurrently) both of these files via TWO commands: 1. by [keyword] (launching processes) - index.js and 2. by [enter] on some operation of the previous result in the launching process of index.js, I'm launching - refresh.js So, my question: Is there any way to launch (concurrently) both of these files by ONE command. By [keyword]. Thnx!
  7. @Xusqui Yes. I think this request excludes Google's blocking errors from your computer.
  8. @Xusqui To rule out the errors related to Google's protections - try to go into this link: https://translate.google.com/translate_a/single?client=t&sl=auto&tl=en&hl=en&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&q=Hello world&tk=535281.958536 You should get the text file with JSON data, otherwise, you'll get the error - kind of 503 or another with some message from Google API.
  9. Hello, it would be a great feature to have possible to set color (bold, italic) for some text for "title", "subtitle". Or for "LargeType". I think it's not just esthetic feature - it has a functional meaning. For example, in my workflow (for Language study) there is no possibility highlight phrase or word, except as braces (braces is not very good readable). But the functionality of this workflow is built entirely of this. Thank you in advance! Expected
  10. This service has another public endpoint of their API - without registration and limitation to 5,000 requests. And its allows downloading the SVG file via my another version workflow simple by click on the one of the search result. But I'm not sure about legality to publishing it. I'm just leaving a link for this alternative version.
  11. Hello everyone. I tried to integrate thenounproject.com service. The main purpose of this workflow is a choice of the icon, by tags, and query words with the possibility get the preview right through the Alfred. So, you can choose some icons for your Alfred workflows and you can see how does it look like immediately. The main function of this workflow is preview icons (many icons), so I suggest flipping through the pages (by hit arrow buttons) instead of scrolling. For that, I limited count of the search result to 12. You can change this optionally (in Alfred preferences) depending on your count of visible result items in Alfred options. (I use 7) and each keystroke to up or down shows by 6 items. It's handy, I think. For use this workflow you will have to free register and get "KEY" and "SECRET" which required to fill into the configuration block of this Workflow. Install $ npm install --global alfred-icons Requires Node.js 7.6+ Usage In Alfred, type icons, Enter, and your query. Use [alt + enter] (⌥ + ↵) to go the collection of some icon in your search result. It's will be signed by this 🧰? And for any result, you can use [cmd + enter] (⌘ + ↵) to continue your search set using 'tags'. It returns you to collections relative with the selected tag. By clicking on the item you can free download (SVG or png) from the page of this awesome service. GitHub Thnx for your interest.
  12. Ok. With my previous questions (1-3) are clear for me now. I'll make my own workflow using node.js
  13. I couldn't access my account with your workflow. I'm a new gitlab user. Could you explain where is I can take gitLab token? 1. (if it from the User Settings => Access Tokens) it must be Feed token or Personal Access Tokens? (what is the option of scopes I should pick up?) 2.What is the correct base URL of API should look like? I can't find this info in https://docs.gitlab.com/ce/api StackOverflow: Can't find out base GitLab API base url - Neither one of the options from here is not working in my case. http://example.com/api/v4 so.. <example.com>, as I understood, is my own server (host)? And: 3. Is this going to work with <gitlab.com>/api/v4? 4. By this <query> I got [ERROR: action.script] Starting debug for 'GitLab-Tool' [2018-11-11 10:54:23][input.keyword] Processing output of 'action.script' with arg 'https://gitlab.com/api/v4' [2018-11-11 10:54:24][ERROR: action.script] . 10:54:23 workflow.py:2055 DEBUG ---------- GitLab-Tool (1.2.0) ---------- 10:54:23 main.py:151 INFO Namespace(issue=None, merge=False, query=None, repo=None, todo=False, token=None, url=u'https://gitlab.com/api/v4') 10:54:23 main.py:40 INFO Setting gitlab url https://gitlab.com/api/v4 10:54:23 workflow.py:2411 DEBUG password exists : :gitlab_url 10:54:24 workflow.py:2458 DEBUG got password : :gitlab_url 10:54:24 workflow.py:2415 DEBUG password unchanged 10:54:24 workflow.py:1462 DEBUG reading settings from /Users/bikenik/Library/Application Support/Alfred 3/Workflow Data/settings.json 10:54:24 workflow.py:2248 DEBUG set last run version: 1.2.0 10:54:24 workflow.py:2097 DEBUG ---------- finished in 0.155s ---------- [2018-11-11 10:54:24][action.script] Processing output of 'output.notification' with arg '' 5. By this <query> I got [ERROR: action.script] [2018-11-11 11:02:23][input.keyword] Processing output of 'action.script' with arg 'oP1536ESz_AEvdMrfEbd' [2018-11-11 11:02:24][ERROR: action.script] . 11:02:23 workflow.py:2055 DEBUG ---------- GitLab-Tool (1.2.0) ---------- 11:02:24 main.py:151 INFO Namespace(issue=None, merge=False, query=None, repo=None, todo=False, token=u'oP1536ESz_AEvdMrfEbd', url=None) 11:02:24 main.py:29 INFO Setting gitlab token oP1536ESz_AEvdMrfEbd 11:02:24 workflow.py:2411 DEBUG password exists : :gitlab_token 11:02:24 workflow.py:2458 DEBUG got password : :gitlab_token 11:02:24 workflow.py:2415 DEBUG password unchanged 11:02:24 workflow.py:1462 DEBUG reading settings from /Users/bikenik/Library/Application Support/Alfred 3/Workflow Data/settings.json 11:02:24 workflow.py:2248 DEBUG set last run version: 1.2.0 11:02:24 workflow.py:2097 DEBUG ---------- finished in 0.160s ---------- [2018-11-11 11:02:24][action.script] Processing output of 'output.notification' with arg '' Thanks in advance.
  14. Mega useful for me. Thnx. p.s. I excluded the warning message by Alfred's utility "Replace" with regex: Warning: Invalid resolution.*?\nEstimating resolution.*?\n
  15. Got this error again today in google-translate-api/index.js:105: 17. In my case err.stack looks like: "HTTPError: Response code 503 (Service Unavailable) at stream.catch.then.data (/Users/bikenik/.npm-global/lib/node_modules/alfred-polyglot/node_modules/got/index.js:123:13) at <anonymous> at process._tickCallback (internal/process/next_tick.js:189:7)" Google message is: So that can't be resolved by updating the token (TKK). I couldn't come up with a solution other than changing my IP using VPN service. or with proxy google-translate-api/issues/70#i. or dedicated IP.
  16. Zondebok, I found two issues and both of them from google-translate-api, apparently. BAD_REQUEST response BAD_NETWORK p.s. I had a similar error from this file and resolved it by VPN. but after a day or two, this problem was gone by default.
  17. Anyway, the network problem. It that line (105:17) in `google-translate-api/index.js` catch the query errors. In logs (Alfred preference => Toggle debugging mode => log [all information]) should be more detail information... Could you get it..
  18. Zondebok, Highly likely it's the network problem. Can you use https://translate.google.com in your country without VPN?
  19. Actions => run scipt => [language: osascript (AS)] on run argv tell application "Finder" to open the startup disk end run
  20. Hello everyone! I tried to integrate such service as Reverso-Context (The search engine for translations in context) Also, this workflow creates flashcards to Anki through the AnkiConnect by the current searching. Install: $ npm install --global alfred-reverso Download and import deck example for Anki to install the template. [includes two note types] Requires: Node.js 7.6+, Alfred Powerpack , Anki intelligent flashcards, AnkiConnect plugin for Anki. Usage: In Alfred, type, reverso, enter , and your query. In Alfred, type reverso * , enter, and your query to search by your favorite phrases. In Alfred, type reverso ! , enter, to set, choose your deck with Anki or delete some. Make a couple of from your source language (srcContext) and target language (trgContext), guided by Reverso site in Alfred workflow configuration. To use your favorite sentences (quick look, adding to Anki) create an account on the Reverso and share your favorite list of sentences. Set your username (userName) in Alfred workflow configuration. Configuration: There are six requirements: note_type: "ReversoContext" - by default don't need to change. For bunch - Target language (searching) => Source language note_type_reverse: "ReversoContext(reverse)" - by default don't need to change. For bunch - Source language (searching) => Target language path_to_anki-media: /Library/Application Support/Anki2/< Profile name of Anki >/collection.media. srcContext: your Source language (e.g Mother tongue). For bunch - Target language => Source language not all couples will be work - check with Reverso site "Arabic", "German", "English", "Spanish", "French", "Hebrew", "Italian", "Japanese", "Dutch", "Polish", "Portuguese", "Romanian", "Russian" trgContext: your Target language (The language which you want to learn). For bunch - Target language => Source language - not all couples will be work - check with Reverso site userName: To use your favorite sentences (quick look, adding to Anki) create an account on the Reverso and share your favorite list of sentences. Set your username. Do not change the default value if you don't want to create an account. More info: github.com/bikenik/alfred-reverso
  21. Alfred 3 workflow to a quick look at Longman dictionary and creating Anki cards (intelligent flashcards). The search, ldoce <query> for Longman Dictionary, uses Pearson's API to hunt for headwords and senses that match headword <query> The search, ldoce <query>, uses Pearson's API to hunt for headwords and senses that match headeword/<query>. 25 results are retrieved by default for headword search. This workflow searches from Longman Dictionary of Contemporary English (5th edition)[ldoce5 - API]. And creates Anki cards by your choices (if an article of the current word in this API not existing audio examples the Alfred will create audio examples from Oddcast. [uses random voices: Julie, Kate, James] I created the video presentation (duration 4 minutes) which explain it better. Look at this in action if you are interested. Install: $ npm install --global alfred-ldoce Download and import the deck example for Anki to install template for this grabbing from ldoce API. Requires: Node.js 4+, Alfred Powerpack, Anki intelligent flashcards, AnkiConnect plugin for Anki. Configuration There are two options: language: Choose your language (it use google-translate-API). path_to_anki-media: by default don't need to. The teaching method used in the Anki template: Scramble is a method of teaching by dividing a worksheet and answer sheet with alternative answers available. The students are expected to look for answers and the solution to a problem that exists. Scramble sentence - is a game to arrange random words to form a specific sentence. The sentence should be logical, meaningful, appropriate, and correct. For example: does – he- where – holidays – go – on? = Where does he go on holidays? went-i-school-to-yesterday = I went to school yesterday More info: Getting started with NPM install from npmjs.com github.com/bikeNik/alfred-ldoce
×
×
  • Create New...