Messages - Nod5 [ switch to compact view ]

Pages: prev1 ... 11 12 13 14 15 [16] 17 18 19 20 21 ... 234next
76
Follow up post to the above GIF tests. This FFmpeg oneliner has nice results
ffmpeg -y -i file.mp4 -filter_complex "[0:v]fps=10,split[v0][v1];[v0]palettegen[plt];[v1][plt]paletteuse" file.gif
ffmpeg.gif (212 kB)
To my eyes it looks less grainy than the earlier GIFs from imgur and cloudconvert, at a pretty small filesize cost.

Found here https://stackoverflow.com/a/60041579 , and the doc page is https://ffmpeg.org/ffmpeg-filters.html#palettegen-1

We can also shave off a few extra kB by going down to fps=5 with similar output quality.

77
Find And Run Robot / FARR mini weather report from wttr.in
« on: November 19, 2020, 11:55 AM »
Wttr is a fun and fast URL based command line weather report tool.
Background and syntax here https://github.com/chubin/wttr.in

This post describes how to show wttr weather as text directly in the FARR searchbox.

wttr.gif

Step 1. create a FARR alias
name: weather
regex: ^(weath|weat|wea)$
result: weather | appcap "C:\folder\FARR_weather_helper.exe"

Step 2. prepare helper AutoHotkey script
- Save code to C:\folder\FARR_weather_helper.ahk
- Modify the wttr URL in the code: which location? what data to show? language? extra text?
- Compile the script to an .exe file (necessary since FARR's appcap doesn't work if we run .ahk scripts uncompiled, it seems)
Code: Autohotkey [Select]
  1.  
  2. ; FARR_weather_helper.ahk
  3. ; 2020-11-19 by Nod5
  4. ; helper script to show weather from wttr.in in FARR searchbox
  5. ; wttr details and syntax at https://github.com/chubin/wttr.in
  6.  
  7. ; prepare wttr URL (must escape each % character with `)
  8. vUrl := "https://wttr.in/london?format=`%c+`%t+`%C"
  9. ; example output: ☀️ +9°C Sunny
  10.  
  11. ; download weather page to variable
  12. vString := urlDownloadToVar(vUrl)
  13.  
  14. ; replace FARR searchbox string with weather string via clipboard paste
  15. ; clipboard pastes all at once so won't trigger other aliases
  16. vBackup := ClipboardAll
  17. Clipboard := vString
  18. Send ^a^v
  19. sleep 500
  20. Clipboard := vBackup
  21. vBackup := ""
  22.  
  23.  
  24. ; function: dowload URL and return it as variable
  25. UrlDownloadToVar(url, raw :=0)
  26. {
  27.   ; prefix https:// if not found
  28.   if( !regExMatch(url,"i)https?://") )
  29.     url := "https://" url
  30.   try
  31.   {
  32.     hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
  33.     hObject.Open("GET",url)
  34.     hObject.Send()
  35.     return raw ? hObject.ResponseBody : hObject.ResponseText
  36.   }catch err{
  37.       MsgBox % err.message
  38.   }
  39.   return 0
  40. }

Alternatives
Here are some alternative ways to use wttr in FARR
  • Load the wttr URL as embedded webpage in FARR
  • Run a script to get the URL weather text and show as a FARR results line via appcapresults
  • Run a script to get the URL weather text and show it in FARR searchbox via FARR's command line parameter -search
But in all these three cases FARR does not show the unicode weather emoji correctly.
However wttr also has options for richer output formats such as multiline or even mapped weather reports as .png images, and that could probably look quite nice in FARR's HTML view.

78
Find And Run Robot / Re: Farr strecthed idea, send key strokes
« on: November 18, 2020, 04:00 PM »
You can create alias actions that send keys to the window that was active before FARR started
example | sendkeys abc
https://www.donationcoder.com/Software/Mouser/findrun/help/using_sendkeys_to_simulate_keypresses.htm
https://www.donationcoder.com/Software/Mouser/findrun/help/virtual_launch_strings.htm

Note to mouser: I noticed that if we chain sleep and sendkeys commands then FARR sleeps, sends the keys and reopens and refocuses FARR. If we don't have the sleep command FARR doesn't reopen after sending the keys. Bug?
example | sleep 2000 ;;; sendkeys abc

79
Is it only one batchfile in a fixed location? In that case, how about an alias for that batchfile, with the path to another file as command line parameter. You type the start of the alias in FARR and then drag and drop the file you want as parameter in the FARR searchbox. Its path will then be added to the FARR searchbox. You next press enter to trigger to alias action. Would look something like this:

https://i.imgur.com/mJgfeP1.mp4

80
Nice 4wd! One idea is to search for artist name and use the first match as artist page URL input into the rest of your program.
The URL format is
https://www.discogs.com/search/?type=artist&title=ac+dc
Other URL parameters can be detected by playing around with options on https://www.discogs.com/search/advanced

This could be a little NANY 2021 app.

Pages: prev1 ... 11 12 13 14 15 [16] 17 18 19 20 21 ... 234next
Go to full version