gingerbeardman Posted June 13 Posted June 13 (edited) Search Moby Games in Alfred Requirements: zsh (macOS default shell) jq (https://jqlang.github.io/jq/download/) Results Game Title Release Platforms and Years Cmd: Moby Games URL Cmd+Shift: Official URL Supports keyword, for searching typed query hotkey, for searching with selected text Config keyword API Key, with instructions https://github.com/gingerbeardman/alfred-moby-games Edited June 13 by gingerbeardman
gingerbeardman Posted June 13 Author Posted June 13 I'd like to add this to Alfred Gallery if possible.
vitor Posted July 10 Posted July 10 @gingerbeardman I have this one almost ready to add, there’s just a couple of details needed: Are you able to provide a retina screenshot? If not let me know and I’ll try to reproduce. The icon is smaller than the minimum 256x256 px. Do you have a larger one?
gingerbeardman Posted July 11 Author Posted July 11 (edited) Done! Retina screenshot now in readme, and icon is now 512×512 px https://github.com/gingerbeardman/alfred-moby-games/releases/tag/1.1 Edited July 11 by gingerbeardman vitor 1
vitor Posted July 16 Posted July 16 I should’ve asked for you to mention me when done. I didn’t see the edit until now because I specifically searched for it. I have this almost ready to go, but I noticed a problem when testing. All of this information must be present: Well, not exactly all of it, but at the very least the Placeholder Title must be there, otherwise users won’t get any feedback that the workflow even exists until it finished running. In other words, you can type moby yoyo and still see no indication the workflow is installed or running until two seconds later when the API returns and the results suddenly populate. It not being there also prevents users from ↩ on it when partially typing the name to make it bubble to the top. The Please Wait Subtext is also useful to indicate when the workflow is contacting the API. Also, it seems that ↩ and ⌘↩ have the exact same behaviour. Is that correct? Finally, I noticed you have an extraneous script and Flickr icon in the workflow.
gingerbeardman Posted August 2 Author Posted August 2 (edited) Thanks! Great improvements @vitor thanks for the PRs I would have not seen these forum replies for a while. I have no idea how the Flickr icon got in there, and also the repo had even more unused files. The "brief.sh" script I may use in future so I've left it for now has been removed. > Also, it seems that ↩ and ⌘↩ have the exact same behaviour. Is that correct? Yes, for now, maybe in future I'll decide a different use for one of them. Thanks for the sanity check. v1.2 is released https://github.com/gingerbeardman/alfred-moby-games/releases/tag/1.2 cheers Edited August 2 by gingerbeardman vitor 1
gingerbeardman Posted August 2 Author Posted August 2 @vitor OK I have removed brief.sh and optimised the icon.png and reissued 1.2
vitor Posted August 2 Posted August 2 @gingerbeardman Now live at https://alfred.app/workflows/gingerbeardman/moby-games/, and a new PR. gingerbeardman 1
gingerbeardman Posted August 2 Author Posted August 2 It would be cool if it could say how easy and free it is to get the "API Key from Moby Games." What I mean is there is no approval or waiting needed.
gingerbeardman Posted August 3 Author Posted August 3 Long search result JSON was being truncated, so I'm limiting to 25 results for now. Version 1.4 is live
vitor Posted August 3 Posted August 3 14 hours ago, gingerbeardman said: It would be cool if it could say how easy and free it is to get the "API Key from Moby Games." What I mean is there is no approval or waiting needed. The messaging for dependencies (including API keys) is standardised as opposed to freeform. The consistency does wonders. Also worth noting being free with no waiting period is the norm for workflows in the Gallery that ask for an API key. 2 hours ago, gingerbeardman said: Version 1.4 is live Live now in the Gallery as well.
gingerbeardman Posted August 4 Author Posted August 4 No worries at all! I've added a little more info in the repo readme, and the "launch" blog post: https://blog.gingerbeardman.com/2024/08/04/search-moby-games-using-alfred-app/ Cheers! vitor 1
vitor Posted August 4 Posted August 4 2 hours ago, gingerbeardman said: blog Nice clean look, I like it. I also noticed a few nice indicators: The pin emoji is for a pinned post. No surprise there. The PlayDate-related posts have a yellow background! Nice touch, I enjoyed figuring out the rule. What’s the heart icon, though? I can see in the DOM that it’s a “fave”, but in practice, what does that mean? Is it for posts you think came out particularly good?
philocalyst Posted August 6 Posted August 6 (edited) Hey! As someone who was just using moby as a web search option, this was super cool to see! It was only working for single-word inputs for me, so I went ahead and added it so it works for multi-word inputs as well if you want to add that to the main functionality: #!/usr/bin/env zsh api_key="${moby_games_api_key}" if [[ $api_key ]] then title="$*" url="https://api.mobygames.com/v1/games" json=`curl --get --data-urlencode "format=normal" --data-urlencode "limit=25" --data-urlencode "title=$title" --data-urlencode "api_key=$api_key" $url` json=${json:gs/\"games\"\:/\"items\"\:} json=${json:gs/"game_id"/"uid"} json=${json:gs/"moby_url"/"url"} # remove description to speed things up json=`echo -E $json | jq '.items |= map(del(.description))'` # add arg which is the URL we will pass to Open URL json=`echo -E $json | jq '.items[] |= (. + {arg: .url})'` # add platforms and release years as subtitle json=`echo -E $json | jq '.items |= map(. + {subtitle: (.platforms | map("\(.platform_name) (\(.first_release_date[0:4]))") | join(", "))})'` # cmd for Moby Games URL, cmd+shift for Official URL json=`echo -E $json | jq '.items |= map(if .official_url then . + {mods: { cmd: {valid: true, arg: .url, subtitle: .url}, "shift+cmd": {valid: true, arg: .official_url, subtitle: .official_url} }} else . + {mods: { cmd: {valid: true, arg: .url, subtitle: .url} }} end)'` echo -n $json fi Thank you for making this workflow a reality! Just a suggestion. Edited August 6 by philocalyst
gingerbeardman Posted August 12 Author Posted August 12 (edited) On 8/4/2024 at 6:19 PM, vitor said: I also noticed a few nice indicators: The pin emoji is for a pinned post. No surprise there. The PlayDate-related posts have a yellow background! Nice touch, I enjoyed figuring out the rule. What’s the heart icon, though? I can see in the DOM that it’s a “fave”, but in practice, what does that mean? Is it for posts you think came out particularly good? Posts about Macintosh and Windows also have different colour background. The "heart" icon is on posts that are my personal favourites, posts that took a lot of work, or most popular in the feedback I've received. It's just a way of me showing the posts new visitors might want to read first. I'm not mad keen on the pin symbol, I'd prefer it to be mono, but I couldn't find an alternative that looked good. Thanks for reading Edited August 12 by gingerbeardman
gingerbeardman Posted August 12 Author Posted August 12 (edited) On 8/6/2024 at 10:17 PM, philocalyst said: Hey! As someone who was just using moby as a web search option, this was super cool to see! It was only working for single-word inputs for me, so I went ahead and added it so it works for multi-word inputs as well if you want to add that to the main functionality: Added in 1.5 ! With a credit to you, thanks. https://github.com/gingerbeardman/alfred-moby-games/releases/tag/1.5 Cheers Edited August 12 by gingerbeardman philocalyst 1
vitor Posted August 12 Posted August 12 56 minutes ago, gingerbeardman said: I'm not mad keen on the pin symbol, I'd prefer it to be mono, but I couldn't find an alternative that looked good. If you need it to be text, then I’m also not familiar with a good looking alternative. But if it can be SVG, here’s a quick drawing: <svg viewBox="0 0 38 68" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"> <path d="M16 37.764C6.937 36.324 0 28.466 0 19 0 8.514 8.514 0 19 0c10.487 0 19 8.514 19 19 0 9.466-6.936 17.324-16 18.764V65a2.999 2.999 0 1 1-6 0V37.764ZM19 9c5.52 0 10 4.481 10 10a2 2 0 0 0 4 0c0-7.727-6.272-14-14-14a2 2 0 0 0 0 4Z"/> </svg> It looks like this:
gingerbeardman Posted August 12 Author Posted August 12 (edited) That's nice, I'll put it on my list of things to do... Oh, and I just remembered that I have a calendar emoji for annual posts. I'll look at doing a custom font with a few characters for all these symbols. Thanks for the idea! Edited August 12 by gingerbeardman vitor 1
gingerbeardman Posted August 20 Author Posted August 20 1.6 adds - support for Quick Look - AlfredExtraPane https://github.com/gingerbeardman/alfred-moby-games/releases/tag/1.6
philocalyst Posted August 20 Posted August 20 Would you consider adding a fallback search option? Mainly for when the API is being slow, the ability to open it in the traditional Moby search would be comforting to me.
gingerbeardman Posted August 20 Author Posted August 20 (edited) Sure, if you want to have a go I'll accept the code change. Bonus points if you can submit as a GitHub Pull Request. Otherwise, I will get around to it at some point soon. Edited August 20 by gingerbeardman
vitor Posted August 20 Posted August 20 5 hours ago, philocalyst said: fallback search option? Open Alfred, paste this link and press ↩ alfred://customsearch/Moby%20Games/moby/utf8/nospace/https://www.mobygames.com/search/?q=%7Bquery%7D
gingerbeardman Posted August 21 Author Posted August 21 (edited) Alfred will grab OpenSearch details if you add custom search, enter the url, and press "lookup" Edited August 21 by gingerbeardman
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now