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

vine-metadata

v1.1.0

Published

Get Vine.co video metadata with a URL or video id.

Downloads

2

Readme

vine-metadata

An NPM module get metadata about videos on Vine.co, working in Vine archival mode.

Installation

This package has no external dependencies, it uses the native Node.JS HTTPS library. Install with npm:

npm install vine-metadata

Usage

This module will retrieve information about a particular video from Vine, given its location (URL or video id). The location can be in any of the following formats, plus any other permutations of their differences:

  • eF1z2H2U01e
  • https://vine.co/v/eF1z2H2U01e
  • http://vine.co/v/eF1z2H2U01e/
  • https://vine.co/v/eF1z2H2U01e?key=value
  • https://www.vine.co/v/eF1z2H2U01e/anything
  • http://www.vine.co/v/eF1z2H2U01e#id

Javascript module

The module only consists of one function, returning a promise to allow asynchronous network access. The only argument is the location of the video.

const vineMetadata=require("vine-metadata");

(async ()=>{
  let location="https://vine.co/v/eF1z2H2U01e";
  try{
    console.log(await vineMetadata(location));
  }
  catch(e){
    console.log(e);
  }
})();

This example will return the following object:

{
  "username": "Zach King",
  "userIdStr": "933563038118858752",
  "postId": 1254511813748785200,
  "verified": 1,
  "description": "Is this stealing?",
  "created": "2015-09-12T15:52:18.000000",
  "permalinkUrl": "https://vine.co/v/eF1z2H2U01e",
  "userId": 933563038118858800,
  "profileBackground": "0x6db0f2",
  "vanityUrls": [
    "Zach.King"
  ],
  "entities": [],
  "postIdStr": "1254511813748785152",
  "comments": 1714,
  "reposts": 13382,
  "videoLowURL": "http://v.cdn.vine.co/r/videos_r2/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4?versionId=wBsiUzb0ZrvaAj9P4wp_lx3zb9WkN1mX",
  "loops": 5379827,
  "videoUrl": "http://v.cdn.vine.co/r/videos/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4?versionId=8ZlDriSUYzhefhySkR2BHijekY32XbuK",
  "videoDashUrl": "http://v.cdn.vine.co/r/videos_h264dash/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4?versionId=RyZBG6okijmsHd.CnnN2oL64cNLwAqDM",
  "thumbnailUrl": "http://v.cdn.vine.co/r/videos/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4.jpg?versionId=tSzEpgEqGrWFeOHEGouJxYDYFoX9m3G7",
  "explicitContent": 0,
  "likes": 99174,
  "videoId": "eF1z2H2U01e"
}

vineMetadata will throw an exception if the video location is supplied in an invalid/unsupported format, or if the video does not exist. It can also throw network errors, or a JSON parse error if Vine supplies the data in an invalid format.

CLI

This module also comes with a CLI component. It can be used either with an argument:

vine-metadata eF1z2H2U01e

Or with stdin from a POSIX pipe:

echo eF1z2H2U01e | vine-metadata

Both commands result in a stringified JSON object sent to stdout:

{"username":"Zach King","userIdStr":"933563038118858752","postId":1254511813748785200,"verified":1,"description":"Is this stealing?","created":"2015-09-12T15:52:18.000000","permalinkUrl":"https://vine.co/v/eF1z2H2U01e","userId":933563038118858800,"profileBackground":"0x6db0f2","vanityUrls":["Zach.King"],"entities":[],"postIdStr":"1254511813748785152","comments":1714,"reposts":13382,"videoLowURL":"http://v.cdn.vine.co/r/videos_r2/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4?versionId=wBsiUzb0ZrvaAj9P4wp_lx3zb9WkN1mX","loops":5379827,"videoUrl":"http://v.cdn.vine.co/r/videos/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4?versionId=8ZlDriSUYzhefhySkR2BHijekY32XbuK","videoDashUrl":"http://v.cdn.vine.co/r/videos_h264dash/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4?versionId=RyZBG6okijmsHd.CnnN2oL64cNLwAqDM","thumbnailUrl":"http://v.cdn.vine.co/r/videos/4B1BC6F25F1254511771919233024_412080db124.0.2.4244536461089371410.mp4.jpg?versionId=tSzEpgEqGrWFeOHEGouJxYDYFoX9m3G7","explicitContent":0,"likes":99174,"videoId":"eF1z2H2U01e"}

Piping example for getting the number of loops a video has:

$ echo eF1z2H2U01e | vine-metadata | grep -Eo "loops\":([0-9]+)\W"
loops":5379827,

Links