jereze Posted May 10 Share Posted May 10 Hi, I'd like to submit a workflow I created for the library. The Hacker News Search Alfred workflow allow searching on the popular tech community site Hacker News. URL : https://github.com/jereze/alfred-hacker-news-search Please let me know the publication procedure. Cheers Link to comment Share on other sites More sharing options...
Stephen_C Posted May 10 Share Posted May 10 You may need to explain how it differs from this existing workflow. (Sorry, I have not used either workflow so I don't know the answer but I thought it worth pointing out the existing workflow in case you had not seen it.) Stephen Link to comment Share on other sites More sharing options...
jereze Posted May 10 Author Share Posted May 10 Sure. Vitorgalvao's workflow only searches from the front page of Hacker News (the latest publications), whereas mine searches the full history. Link to comment Share on other sites More sharing options...
Stephen_C Posted May 10 Share Posted May 10 Thanks for the explanation: I'm sure it will be useful to others. Stephen jereze 1 Link to comment Share on other sites More sharing options...
vitor Posted May 10 Share Posted May 10 1 hour ago, jereze said: Please let me know the publication procedure. Everything is covered in the pinned post. At a glance, you’re missing a list of dependencies and a proper screenshot. Once those are provided I’ll proceed with the review. Link to comment Share on other sites More sharing options...
jereze Posted May 10 Author Share Posted May 10 (edited) Thanks for your answer. My bad, I thought having them in the README file on Github was enough. Screenshot: Same with transparency : Dependency: * jq Edited May 10 by jereze Link to comment Share on other sites More sharing options...
vitor Posted May 10 Share Posted May 10 There’s no packaged release. You need to make a release for the workflow and attach the packaged .alfredworkflow there. Link to comment Share on other sites More sharing options...
jereze Posted May 10 Author Share Posted May 10 19 minutes ago, vitor said: There’s no packaged release. You need to make a release for the workflow and attach the packaged .alfredworkflow there. Done : https://github.com/jereze/alfred-hacker-news-search/releases/tag/v1.0.0 Link to comment Share on other sites More sharing options...
vitor Posted May 10 Share Posted May 10 Almost ready to go, but your icon is under 256x256px. It needs to be at least that size. In addition, you don’t have to add an icon to the Script Filter if is uses the same as the workflow, Alfred will use it by default. Link to comment Share on other sites More sharing options...
jereze Posted May 10 Author Share Posted May 10 51 minutes ago, vitor said: Almost ready to go, but your icon is under 256x256px. It needs to be at least that size. In addition, you don’t have to add an icon to the Script Filter if is uses the same as the workflow, Alfred will use it by default. Got it. Done : https://github.com/jereze/alfred-hacker-news-search/releases/tag/v1.0.1 Link to comment Share on other sites More sharing options...
vitor Posted May 10 Share Posted May 10 Just noticed a problem when doing the final tests. Search for Twitter's things. Do you see how some of the items don’t have a title? That should be fixed. Also, I have a few code suggestions:You don’t need the #!/bin/bash shebang at the top. You’re already telling Alfred to use /bin/bash so it’s not doing anything.Your jq message will show a dialog to the user but it could instead show the message in Alfred and make the result invalid.You’re only escaping a few characters in QUERY. It would be more robust to URL encode the full text.The following code addresses the three suggestions above. But the more pressing thing is to fix the lack of titles in some cases. Once that’s addressed the workflow can go in, I have the Gallery page done and ready. if ! command -v dsfds &> /dev/null; then echo '{ "items": [{ "title": "jq is not installed", "subtitle": "Use Alfred’s Dependency Manager to install it", "valid": false }] }' exit 1 fi QUERY="$(/usr/bin/osascript -l JavaScript -e 'function run(argv) { return encodeURIComponent(argv[0]) }' "${1}")" curl -s "https://hn.algolia.com/api/v1/search?query=${QUERY}" | jq \ '{ "items": [.hits[] | { uid: .objectID, title: (.title // .comment_text), subtitle: "\(._tags[0]) | \(.created_at[0:10]) | \(.points // 0) pt", arg: "https://news.ycombinator.com/item?id=\(.objectID)" } ] }' Link to comment Share on other sites More sharing options...
jereze Posted May 10 Author Share Posted May 10 Thank you @vitor for your review and suggesting these nice enhancements. I would not have been able to do the espacing with osascript. I released a new version: https://github.com/jereze/alfred-hacker-news-search/releases/tag/v1.0.2 vitor 1 Link to comment Share on other sites More sharing options...
vitor Posted May 10 Share Posted May 10 Thank you for the fast fixes. This will be live later today at https://alfred.app/workflows/jereze/hacker-news-search/. jereze 1 Link to comment Share on other sites More sharing options...
jereze Posted May 10 Author Share Posted May 10 Great, thanks! Link to comment Share on other sites More sharing options...
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