Jump to content

niclake

Member
  • Posts

    7
  • Joined

  • Last visited

niclake's Achievements

Helping Hand

Helping Hand (3/5)

1

Reputation

  1. Trying to create a little workflow as practice. Querying an API, parsing the response, and then (trying to) copying the result to my clipboard. Here's my script: require 'json' require 'uri' require 'net/http' uri = URI("https://baconipsum.com/api/?type=all-meat&start-with-lorem=1&paras=5") res = Net::HTTP.get_response(uri) value = "" JSON.parse(res.body).each do |i| value += i + " " end puts({ items: [value] }.to_json) I get the data back just fine, and it's being returned as an appropriate json hash, but the Alfred window will just sit open and not accept me hitting Enter to copy it to my clipboard.
  2. @vitorThank you so much, that's exactly what I was looking for!
  3. I have a simple workflow that allows users to pull down their GitHub repos, search for them within Alfred, and then (currently) do one of 5 actions based on which modifier key is held down (i.e. ⌘-Enter will copy the repo URL, while just pressing Enter opens it in the browser). What I would love to do is to set those actions & keys as the default, but allow users to modify which one points to what. I figured the easiest way was to use dropdowns to let the user change behavior (i.e. the user could have ⌘-Enter go to the repo's pull requests instead), but I have absolutely no clue how I would go about setting this up. Does anyone have any examples I could utilize? I'm also doing my best to keep this as a workflow that can be included w/in Workflow Configuration, so that it could still be included in the Gallery.
  4. Bumping this up to see if there's interest.
  5. Hi everyone. I have a query running that's returning the following json: { "items": [ { "arg": [ "https://github.com/niclake/advent-of-code-22", "advent-of-code-22" ], "uid": 574776691, "title": "advent-of-code-22", "subtitle": "My Advent of Code 2022 code - https://adventofcode.com/2022/" }, ] } This is then returned to Alfred as an item to show in the window. On my computer, both the `title` and `subtitle` are displaying correctly. On other's computers, the `subtitle` will not show in the Alfred window. Their example window: And mine: Here's the code I'm working with: https://github.com/niclake/alfred-github-repo-helper Any assistance here would be incredible.
  6. Hello! Just created this workflow, and ready to release it to the public. It's called GitHub Repositoriy Helper. Essentially, this uses your GitHub username & an access token to grab all of your repository names, and allow you to navigate directly to the repo, copy its url, or jump to its pull requests, issues, or projects page. Say if you’re the author or submitting someone else’s workflow. I am the author of this workflow. Share a link to its thread on the Alfred Forum, if available. Share a link to its main page (e.g. GitHub) https://github.com/niclake/alfred-github-repo-helper If it has dependencies, say what those are unless they are explicit in the About or README. jq must be installed at /opt/homebrew/bin/jq (you can use which jq to check). If not installed, you can do so with brew: brew install jq Provide screenshots
  7. Just created GitHub Repositoriy Helper, a small workflow for Alfred. Essentially, this uses your GitHub username & an access token to grab all of your repository names, and allow you to navigate directly to the repo, copy its url, or jump to its pull requests, issues, or projects page. Download the workflow here || View the source code and README Setup Navigate to https://github.com/settings/tokens, and create a new Fine-Grain Token Set the repo access to your desired level (recommended: All repositories) If you set it to All repositories, under Repository permissions, find Metadata and set it to Read only Save & generate the token, and copy the value Set your GH_USERNAME and GH_TOKEN environment variables. Make sure that jq installed at /opt/homebrew/bin/jq (you can use which jq to check). If not installed, you can do so with brew: brew install jq Usage Use the ugh command to update your GitHub repo list. This will fetch all of the repos that you are a owner or contributor to, sanitize them, and generate your list Once your list has been generated, gh <repo_name> will pull up the repository link, and you can then do the following: Enter: go to repo ⇧-Enter: go to pull requests ⌥-Enter: go to issues ⌃-Enter: go to projects ⌘-Enter: copy the repo URL to your clipboard Note: If any part of the ugh command fails, right-click the workflow in the sidebar, Open in Terminal, run chmod 777 *.sh, and then try the ugh command again
×
×
  • Create New...