Giter Site home page Giter Site logo

nathangathright / alfred-producthunt-search Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 409 KB

Search Product Hunt posts from Alfred

Home Page: https://nathangathright.github.io/alfred-producthunt-search/

License: MIT License

JavaScript 100.00%
alfred-workflow alfred alfy producthunt algolia

alfred-producthunt-search's Introduction

alfred-producthunt-search

Search Product Hunt posts from Alfred

screenshot

Installation

Download and install the latest release

You will need Alfred Powerpack to enable this workflow.

Usage

hunt

Type the keyword hunt, enter your query, and select a result.

  • Press Return to open the Product Hunt post for the selected result.
  • Press + Return to open the external link post for the selected result.
  • Press + C to copy the URL of the selected result to your clipboard.

hunted

Type the keyword hunted and enter a URL to check if it’s already been submitted to Product Hunt.

  • If the URL is found on Product Hunt, press Return to open the Product Hunt post.
  • If the URL is not found on Product Hunt, press Return to open the Product Hunt submission page.

Alternatively, set up a hotkey in Alfred to pre-populate the hunted URL from your frontmost browser window.

Credits

License

MIT © Nathan Gathright

alfred-producthunt-search's People

Contributors

chrismessina avatar nathangathright avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

chrismessina

alfred-producthunt-search's Issues

Error: Cannot find module 'dotenv/config'

When attempting to execute the "hunted" featured, I now get an error:


ERROR: Product Hunt Search[Script Filter] Code 1: node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'dotenv/config'
Require stack:
- internal/preload
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at Module._preloadModules (node:internal/modules/cjs/loader:1272:12)
    at loadPreloadModules (node:internal/bootstrap/pre_execution:474:5)
    at prepareMainThreadExecution (node:internal/bootstrap/pre_execution:77:3)
    at node:internal/main/run_main_module:7:1 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'internal/preload' ]
}

Node.js v17.3.0

Something broke...!

Seeing this error when I attempt to execute a search:

2021-09-15 (12 44 49) Alfred Preferences

Here's the console log:

[12:44:31.626] Logging Started...
[12:44:32.343] Product Hunt Search[Script Filter] Queuing argument 'nft'
[12:44:32.998] Product Hunt Search[Script Filter] Script with argv 'nft' finished
[12:44:33.001] ERROR: Product Hunt Search[Script Filter] Code 1: {
	"items": [
		{
			"title": "TypeError: Cannot read property 'image_uuid' of undefined\n    at /Users/messina/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B46BDEF-00AD-4617-97D6-0C3641B32184/index.js:75:63\n    at Array.forEach (<anonymous>)\n    at /Users/messina/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B46BDEF-00AD-4617-97D6-0C3641B32184/index.js:73:7\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)",
			"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
			"valid": false,
			"text": {
				"copy": "```\nTypeError: Cannot read property 'image_uuid' of undefined\n    at /Users/messina/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B46BDEF-00AD-4617-97D6-0C3641B32184/index.js:75:63\n    at Array.forEach (<anonymous>)\n    at /Users/messina/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B46BDEF-00AD-4617-97D6-0C3641B32184/index.js:73:7\n```\n\n-\nProduct Hunt Search 1.2.4\nAlfred 4.6\ndarwin 20.6.0",
				"largetype": "TypeError: Cannot read property 'image_uuid' of undefined\n    at /Users/messina/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B46BDEF-00AD-4617-97D6-0C3641B32184/index.js:75:63\n    at Array.forEach (<anonymous>)\n    at /Users/messina/Dropbox/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1B46BDEF-00AD-4617-97D6-0C3641B32184/index.js:73:7"
			},
			"icon": {
				"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
			}
		}
	]
}

Suggestion: cache results

Might it make sense to cache results to speed up responsiveness? Maybe expire cache after a month, or add a command to refresh the cache?

[FR] Quick check to see if a URL has been hunted

Would be very useful to quickly submit a URL via this Workflow to check if it's been previously hunted.

Suggested features/design:

  • use keyword hunted and then the URL to execute command
  • use hotkey to check the clipboard
  • post notification with yes/no status ("Looks like this URL hasn't been hunted!" or "This URL has already been hunted for [Product Name]. Click to view hunt")
  • normalize URL to its canonical form

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.