npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@orbit-love/producthunt

v0.3.1

Published

Integrate Product Hunt votes into Orbit workspaces

Downloads

5,053

Readme

Product Hunt to Orbit Workspace

Build Status npm version Contributor Covenant

This is a JavaScript package that can be used to integrate new Product Hunt votes and comments into your organization's Orbit workspace.

|:sparkles: This is a community project. The Orbit team does its best to maintain it and keep it up to date with any recent API changes.We welcome community contributions to make sure that it stays current. :sparkles:| |-----------------------------------------|

There are three ways to use this integration. Install package - build and run your own applications. Run the CLI - run on-demand directly from your terminal. Schedule an automation with GitHub - get started in minutes - no coding required

First Time Setup

  1. Create a new Product Hunt API Application
    1. Redirect URI can be any web address
    2. Take note of your API Key and API Secret

Application Credentials

The application requires the following environment variables:

| Variable | Description | More Info |---|---|--| | PRODUCT_HUNT_API_KEY | API Key for your Product Hunt Application | Follow the guide above | PRODUCT_HUNT_API_SECRET | API Secret for your Product Hunt Application | Follow the guide above | ORBIT_API_KEY | API key for Orbit | Found in Account Settings in your Orbit workspace | ORBIT_WORKSPACE_ID | ID for your Orbit workspace | Last part of the Orbit workspace URL, i.e. https://app.orbit.love/my-workspace, the ID is my-workspace

Package Usage

Install the package with the following command

$ npm install @orbit-love/producthunt

The standard initialization of the library requires the following signature:

const OrbitProductHunt = require('@orbit-love/producthunt')
const orbitProductHunt = new OrbitProductHunt('orbitWorkspaceId', 'orbitApiKey', 'productHuntApiKey', 'productHuntApiSecret')

If you have the following environment variables set: ORBIT_WORKSPACE_ID, ORBIT_API_KEY, PRODUCT_HUNT_API_KEY, and PRODUCT_HUNT_API_SECRET then you can initialize the client as follows:

const OrbitProductHunt = require('@orbit-love/producthunt')
const orbitProductHunt = new OrbitProductHunt()

Get Product IDs Made By A User

const products = await orbitProductHunt.getProducts('_phzn')
console.log(products)

Add New Votes On Product

const votes = await orbitProductHunt.getVotes(productId)
const prepared = await orbitProductHunt.prepareVotes(votes, 24) // 24 is the number of previous hours to get votes from
const outcome = await orbitProductHunt.addActivities(prepared)
console.log(outcome)

Add New Comments On Product

const votes = await orbitProductHunt.getComments(productId)
const prepared = await orbitProductHunt.prepareComments(votes, 24) // 24 is the number of previous hours to get votes from
const outcome = await orbitProductHunt.addActivities(prepared)
console.log(outcome)

CLI Usage

To use this package you do not need to install it, but will need Node.js installed on your machine.

npx @orbit-love/producthunt --products --user=username

# Add new votes or comments
npx @orbit-love/producthunt --votes --id=projectid
npx @orbit-love/producthunt --comments --id=projectid

# Add new votes and comments
npx @orbit-love/producthunt --votes --comments --id=projectid

By default this will get the last 1 hours worth of votes, but this can be explicitly overridden:

npx @orbit-love/producthunt --votes --id=projectid --hours=12

GitHub Actions Automation Setup

⚡ You can set up this integration in a matter of minutes using our GitHub Actions template. It will run regularly to add new activities to your Orbit workspace. All you need is a GitHub account.

See our guide for setting up this automation

Contributing

We 💜 contributions from everyone! Check out the Contributing Guidelines for more information.

License

This project is under the MIT License.

Code of Conduct

This project uses the Contributor Code of Conduct. We ask everyone to please adhere by its guidelines.