youtube-to-twitter
Download video from youtube channel and upload it twitter.
Last updated 8 months ago by teramotodaiki .
MIT · Original npm · Tarball · package.json
$ cnpm install youtube-to-twitter 
SYNC missed versions from official npm registry.

YouTube to Twitter

Download video from youtube channel and upload it twitter.

Install

npm install --save youtube-to-twitter

Example

See server.js

const express = require('express');
const { download, trim, tweet, upload, video } = require('youtube-to-twitter');

const app = express();

app.get('/', async (req, res) => {
  res.sendStatus(200);

  main()
    .then(console.log)
    .catch(console.error);
});

const port = process.env.PORT || 3000;
app.listen(port, () => {
  console.log(`listen on port ${port}`);
});

async function main() {
  const start = parseInt(process.env.VIDEO_START, 10) || 0;
  const duration = parseInt(process.env.VIDEO_DURATION, 10) || 30;

  const { title, url } = await video();
  const status =
    title.replace(/【ハックフォープレイ実況】/, ' #HackforPlay') +
    '\n\nつづきはこちら↓\n' +
    url;
  console.log('next tweet:\n', status);

  const source = await download(url);
  const output = await trim(source, start, start + duration);

  const mediaId = await upload(output);
  await tweet(mediaId, status);
}

Current Tags

  • 1.1.0                                ...           latest (8 months ago)

2 Versions

  • 1.1.0                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |