Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

instalike

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

instalike

Embeddable like button for anything.

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Instalike Build Status npm version

Attractive, anonymous, globally-aware like buttons for anything. Simple embed an iframe in your website and it will use the public API. Or, you can self-host the API in order to add a custom like button to your nodejs project. You can use Instalike buttons to hold informal polls, to ask the internet for approval, and even to impress your friends.

preview.gif

Usage

There are 2 ways you can use Instalike: with the public API, or as a self-hosted node package.

Option 1: Use the public API

Place the <iframe> into your HTML, and specify a THING to keep track of. (Thing names are case-sensitive and can contain any Unicode characters.) That's it! The http://instalike.click website will automatically use the public API to keep track of the like count for your "thing." Optionally, you can specify align=right to make the button right-aligned (default is left-aligned).

<iframe src="//instalike.click/button/?thing=THING&align=left" frameborder="0" scrolling="0" width="140px" height="20px">
</iframe>

API hosting provided by Cimpress. The API supports GET/POST/PATCH http://instalike.click/api/THING.

Option 2: Host the API yourself

Install the npm module if you want to host the API yourself. This is perfect for on-premesis enterprise installations.

$ sudo npm install -g gulp
$ npm install instalike
$ redis-server & # or start it as a service
$ npm start

# Note: stop redis safely using redis-cli
$ redis-cli
127.0.0.1:6379> shutdown
2002:M 20 Jul 16:50:13.137 # User requested shutdown...
2002:M 20 Jul 16:50:13.137 * Saving the final RDB snapshot before exiting.
2002:M 20 Jul 16:50:13.138 * DB saved on disk
2002:M 20 Jul 16:50:13.138 # Redis is now ready to exit, bye bye...
not connected> exit
Job 1, 'redis-server &' has ended

Development

Pull requests welcome. The tech stack is very simple:

  • Backend (api)
    • Node.js
    • Express.js
    • Swagger-Tools
    • Mocha for testing
    • Hosted on-prem
  • Frontend (buttons)
    • Source is JS (zero external dependencies)
    • Source is HTML + CSS3
    • Uses FontAwesome icons
    • Built by Gulp

The ./public directory contains all the source files:

Here are examples of calls to the JSON API:

GET /api/{thingName} HTTP/1.1
Host: instalike.click
Accept: application/json

200 OK
{
  "thing": "{thingName}",
  "count": 42
}
POST /api/{thingName} HTTP/1.1
Host: instalike.click
Accept: application/json

200 OK
{
  "thing": "{thingName}",
  "count": 43
}
PATCH /api/{thingName} HTTP/1.1
Host: instalike.click
Accept: application/json

200 OK
{
  "thing": "{thingName}",
  "count": 42
}

FAQs

Package last updated on 30 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc