Jump to content

elnadav12

Member
  • Posts

    18
  • Joined

  • Last visited

Posts posted by elnadav12

  1. 2 minutes ago, DrewOS said:

    You might be able to do something using Shortcuts with the Music app Shortcuts can be called from command line so can be added to Alfred workflows.

    Cool idea, but music app shortcuts are only useful for library stuff from my experience…

    You can’t really input a song or artist and make it play the right one… Lacks Siri’s intelligence (better than nothing right?🤪).

    Also, Siri can understand stuff like “shuffle my library”, “play my station” etc.

    Seems like this workflow will take a lot of work and many shortcuts to do basic things…

    Do you have any smart ideas regarding the implementation? I tried something similar here but it didn’t work well…

     

  2. Hello friends,

    I've been struggling with Apple Music for a long time.

    I really like Siri's "play some music" feature, which plays a random personalized station.

    But, to my knowledge the only way to invoke it is using Siri or through the recently played menu in the app.

    In general, I'd like to give commands to Siri using Alfred, but the only way I've come up with is using "type to Siri", causing an annoying pop up menu that takes decades to disappear...

    Do you have any ideas for improvement?

    Thanks :)

     

    1046417942_ScreenShot2022-01-01at2_31_23.thumb.png.cc4298ee9e38d850d428c9416ee10a5d.png

     

  3. 14 hours ago, Andrew said:

    Just to let you know, I'm working on new theming options which will allow for rounded corners and also to use the native macOS Visual Effect view (the blur effect you get in Spotlight and various windows around macOS). A side effect of the using this native view type is getting proper window surround, and no fuzzy corners.

     

    Here is an example:

     

    Alfred 4.3 theme example

     

     

    That's great!

  4. This theme is absolutely awesome.

    Most people won't even notice that's not spotlight!

    The only thing I changed was the horizontal window padding -> zero.

    The rounded corners glitch is a little annoying but that's a small compromise for this incredible design!

    Thanks Julian!

    101675242_AlfredDarkSky.thumb.jpg.0a3712970c90fe91746b4e4c8de23660.jpg

  5. 1 minute ago, vitor said:

    Make a Script Filter with ruby as the language and this code:

     

    
    require 'cgi'
    require 'json'
    require 'net/http'
    
    query = ARGV[0]
    escaped_query = CGI.escape(query)
    
    simple_api = 'https://api.wolframalpha.com/v1/simple?i=' + escaped_query + '&appid=' + ENV['api_key']
    short_answers_api = 'https://api.wolframalpha.com/v1/result?i=' + escaped_query + '&appid=' + ENV['api_key']
    
    result = Net::HTTP.get_response(URI.parse(short_answers_api)).body
    
    puts({ items: [ title: result, subtitle: query, arg: result, quicklookurl: simple_api ] }.to_json)

     

    Results are inline and you can press ⇧ or ⌘Y to get a quicklook preview of the page.

     

    It assumed you’ve got an API key and placed it in a api_key Workflow Environment Variable.

    Thanks a lot!

    The API is limited to 2000 calls a month, will this script call the api each time I write a new letter?

     

  6. 1 hour ago, deanishe said:

     

    Either. Or Ruby. Pretty much any general-purpose language has the features you need (URL encoding, HTTP client & JSON).

    Thanks for the help!

    Is this code any good?

    Quote

    require("workflows.php");
     
    $wf = new Workflows();
    // $word = "{query}";
    $word = str_replace(' ', '+', "{query}");
    $url = "http://api.wolframalpha.com/v1/result?appid=DEMO&i=".$word;
    // replace file_get_contents with $wf->request
    // it's not better, it's cleaner IMHO
    $answer = $wf->request( $url );
    // $raw = file_get_contents( $url );
    $wf->result( time(), $url, $answer, 'WolframAlpha search result', 'icon.png', 'yes', $url);
    echo $wf->toxml();

     

  7. Hello,

    After some looking around I found this workflow that uses WolframAlpha's api to get direct search results.

    https://www.packal.org/workflow/wolframalpha

    This workflow is very cool but takes ages to load.

    WolframAlpha has a cool short answer api that returns answer to a url with the question.

    https://products.wolframalpha.com/short-answers-api/documentation/

    Since it's that simple I imagine that making a workflow that fetches the url, for example "http://api.wolframalpha.com/v1/result?appid=DEMO&i={query}", and returns the result as an Alfred title wouldn't be hard to make, and should run fast...

    What's the right language for the job? PHP? Python? I'm not really sure.

    I have no experience with both so where should I begin?

    Thanks for your time!

×
×
  • Create New...