Jump to content

Search the Community

Showing results for tags 'json'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting

Categories

  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Twitter


Website URL


Jabber


Location


Interests

Found 13 results

  1. I'm starting out trying to make workflows and have to this point just managed to do web searches on a specific website by using Alfred's buildt inn function with the {query} option. This has worked out perfectly with sites that displays a HTTP address for a search, but how can i tackle pages that does not do this? ATM i'm trying to make a search for this page http://www.magnusli.no/ifirooms/. I tried to inspect the getRoom() function and stole a link from there include/get_room.php?id= and tried to use the {query} on that (with eg. 'Caml' as a search) and that worked to a point where the function returned the data for that search, but that was not what i intended to do. The request returned this: Wanted outcome: Any tips or input as to where to start or how to tackle an issue like this would be much appreciated. Thank you!
  2. This is my error : [ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON: input the {"items":[]} "input the" is the result of code "echo $userInput This Alfred node, runs a script called search.rb. I've screen shotted it below as well. The script calls all redbooth API's(a project management app) Projects, Tasklists and tasks. It then runs a loop through each item and looks for titles that match the user input/ARGV. I have run the script locally in my terminal and the script returns the correct objects and should be printing them/returning to Alfred. However I get the above issue and I can't seem to figure out where my disconnect is. Additional info/screen shots below. search.rb/the script alfred runs to generate the script filter options. This code(below/list_proj.rb) calls the redbooth API and takes all returned objects/projects and converts the data to json. When the script rubs as is in a alfred script node- it populates the filter options. This code works to the desired effect. Posting for comparison This is a snap shot of the work flow. Everything works with the exception of the Search function/nodes Please let me know if I can provide anything else. I have a separate plugin that provides user auth for the work flow to access the redbooth client API. Any insights to this error or what I may have missed would be well appreciated. Thanks!
  3. I'm new to creating Workflows. I'm trying to create a workflow that will pull the data via API to JSON and show results directly in Alfred without the need to visit the website to look at the response. API REQUEST GET https://api.website.com/?domain=test.com&apikey=yourapikey&output=output_type So, what I'm trying to do is this: type "dns test.com" then request is: GET https://api.website.com/?domain=test.com&apikey=123123123123123&output=json The response will be: JSON response will look like this: { "query": { "tool": "name of the tool", "domain": "test.com" }, "expectedresponse": "205.204.123.234", "response": { "server": [ { "location": "Town, Country", "resultvalue": "205.204.123.123", "resultstatus": "ok" }, { "location": "Another Town, Another Country", "resultvalue": "205.204.123.234", "resultstatus": "ok" }, ] } } and I'm trying to show it in the Alfred window: DNS test of test.com Expected Response: 205.204.70.111 1. Town, Country - 205.204.123.123 - NOT OK 2. Another Town, Another Country - 205.204.123.234 - OK etc. Any help would be appreciated
  4. I'm new to writing workflows. I'm having a trigger that launches a php script, I have a loading text for that trigger, but the items returned by my script will also take time when the user chooses them, so I'd like to change also the subtitle once it's chosen, so that the user knows something is being worked on after his choice. Is there a way? Or am I missing something in how the script filters work? I am not launching another script once the user selects an option, and I don't post anything (just grabbing data from an API, and injecting the results in Alfred items at the final step). Thanks
  5. Working on Workflow...Script Filter Alfredv3.1.1 (737) Mac O SX 10.12 Dropbox Link <removed> Trying to get the results displayed as choices in Alfred. Error [ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON With (bash) base_uri="https://xyz.execute-api.us-west-2.amazonaws.com/prod/listfromalfred?user=${user}&task=${data}" post_result=$(/usr/local/bin/curl -X GET ${base_uri}) post_success=`echo ${post_result} | grep items` echo ${post_success} | sed 's/\\//g' This test code works #test='<items><item uid= "test " arg= "one "><title>em11@mail.com</title><subtitle>em11@mail.com</subtitle><icon>icon.png</icon></item></items>' #echo ${test} However, when I call the API I get: 'Response code: 200\n' [2016-10-23 12:19:23][ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON: "<items><item uid= "test" arg= "one"><title>em11@mail.com</title><subtitle>em11@mail.com</subtitle><icon>icon.png</icon></item></items>" Debugging for hours and can't seem to fix the issue. Trying to get the results displayed as choices in Alfred. HELP
  6. A tiny thing, really. In the documentation for the JSON feedback format, the term "array" is used for JSON objects. text, mod and icon are objects. items is an array (inside an object). In JavaScript, and thus JSON, "arrays" are ordered lists: ["this", "is", "an", "array"], while dictionaries/mappings are called "objects": {"this": "is", "an": "object"} (In JS, thing["key"] is equivalent to thing.key) http://www.json.org
  7. Currently, if I output the following: {"items": [ { "title": "Foo", "arg": "unicorn" } ]} I have to handle the `unicorn` arg in a connected output action in the workflow. It would be useful to be able to dynamically handle it without needing to create an output action. This can be useful for very dynamic results and creating reusable modules that create output with different actions. I propose adding a `script` property to the JSON format that when specified makes it not pass the output to any connected output action (like `valid: false`) and instead executes the `script` and passes `arg` to it. {"items": [ { "title": "Foo", "arg": "unicorn", "script": "run-foo.sh" } ]} This would make script filters a lot more powerful.
  8. Hi, I'm using Alfred 3's Script Filter + JSON format to return a list. However, I found that despite I output a static ordered list, the ordering that display on Alfred is dynamic. That is, Alfred seems to alter the ordering. It looks like Alfred tend to put the most recent used item to the top. I'm wondering if there is any way to configure this behavior or turn it off? Thanks.
  9. Good morning, I'm currently trying to create a simple Script Filter Alfred 3 Workflow using Python. I found an earlier example which demonstrated how to pass XML results to a Python workflow: xmloutput = """ <?xml version="1.0" encoding="utf-8" ?> <items> <item arg="testitem"> <title>FooBar</title> <subtitle>foo bar is a test item</subtitle> <icon>icon.png</icon> </item> </items> """ print(xmloutput) My question is, what is the syntax for doing the same with the new JSON data structure? regards, Andrew
  10. Is it possible to use a JSON Config block to affect the keyword of a connected block? I've tried copying the copy the config of a Script Filter block into a JSON Config block and changing the keyword, but it appears to have no effect. Overall, can anyone provide any details on how the JSON Config blocks are intended to be used?
  11. Hello, Im rewriting my old alfred 2 workflows using great alfred 3 json api and it is difficult to understand what icon types I can use - https://www.alfredapp.com/help/workflows/inputs/script-filter/json/- it is not clearly described there(( "icon": { "type": "fileicon", "path": "~/Desktop" } - What other icon types I can use? Can I load icons using url? (I know that was impossible in alfred 2) or I should use something like https://github.com/sananth12/ImageScraper ? this is my old workflow preview I use it not only for movies but for parsing dynamic web content and an ability to load images using url and dynamicly resize them would make my life much easier - If it is not possible it is ok - I just wanted to check in case I missed it
  12. Hi, (among other starter problems) I have the following problem: The below script runs fine in the Mac OSX terminal. But as an "run script" action (type "python") it hangs. When I delete the urlopen line the script runs to the end (but of course without a JSON result). The small workflow is here: http://d.pr/f/K3t So something seems to be wrong with the line "response = urllib2....": import urllib2 import urllib import json url='{query}' endpoint='http://api.longurl.org/v2/expand' params = {'url':url, 'title':'1','format':'json'} response = urllib2.urlopen(endpoint+'?'+ urllib.urlencode(params)) try: json_data = json.loads(response.read()) print 'URL: '+json_data[u'long-url'] #print 'Page title: '+json_data[u'title'] except: print 'Sorry - could not find the long URL' How can I debug this? How should I retrieve a JSON result from a webservice? Thanks in advance! Thomas
  13. Workflows' JSON API (new) (Recommended) API on Github: https://raw.github.com/hzlzh/AlfredWorkflow.com/master/workflow-api.json API backup: http://www.alfredworkflow.com/workflows-api/ -- API info -- Download Link by Author = workflow-download-link (Important!) Backup download link on Github = https://raw.github.com/hzlzh/AlfredWorkflow.com/master/Downloads/Workflows/ + workflow-file Everyone can load all the workflows' download links by using this API, mybe @phyllisstein can add this in Alleyoop.
×
×
  • Create New...