Twitter bot to find what song is playing in a given uploaded twitter video.

Overview

what-song-is-this

Twitter bot to find what song is playing in a given uploaded twitter video.

How to setup.

yarn install

How to run.

  • via npm script
yarn start
  • via node in terminal
node --experimental-wasm-threads src/app.js

This bot makes use of the wasm ffmpeg package for converting between multimedia types. Running webassembly with threads on node js requires the experimental-wasm-threads flag when starting.

Testing

yarn test

Test files should be created with '.test.js' prefix.

How it works

  • A twitter user would tag the bot under a video with @whatsongishere
  • The bot running in a loop(cron job) would listen for its mentions.
  • For any mention found, it checks firstly for if it has attended to this mention before. If it has, it ignores the mention
  • If it hasn't attended to this mention before, it checks the DB if it has been mentioned on that song before. If it has, it uses the same response from before.
  • If it hasn't been mentioned to the video before, it converts the video to the required format and makes a request to the shazam API to recognize it.
  • Depending on the response from shazam(or whatever service integrated) it replies the at with the relevant reply.

whatsongishere-in-action

Currently receiving contributions for Hacktoberfest. PRs are not limited to the issues created.

Comments
  • Unit test configured

    Unit test configured

    I have configured the test so we can import modules via the esm without any errors using babel and I have written test for generateVideoTag util function.

    image

    don't mind the redlines, that's eslint acting up on my editor but the test runs.

    hacktoberfest-accepted hacktoberfest 
    opened by Xavier577 5
  • Tweet endpoints

    Tweet endpoints

    Create the tweet endpoint

    This is a post endpoint. When this endpoint is hit with a JSON payload as shown below, it would post the tweet and save it to the DB. If the text is more than 208 characters, an error message is thrown. The response would be the tweet data from Twitter.

    {
        "tweet": "tweet text" 
    }
    

    For now, the authentication for tweeting is going to be a generated token hard coded as an env variable AUTH_TOKEN

    hacktoberfest 
    opened by bolubee101 0
  • heroku deploy ready

    heroku deploy ready

    In this PR

    • Express was added to the project to enable it to bind with heroku's HTTP port.
    • The Procfile was added to enable deployment to Heroku.

    It closes #10

    hacktoberfest-accepted hacktoberfest 
    opened by bolubee101 0
  • Make project Heroku deployment ready

    Make project Heroku deployment ready

    Till Further notice, this Project would be hosted on Heroku. With that in mind, it is required that it is bounded to a port to keep running, therefore a server would be set up. This server would also serve as the foundation for any other server-based functionality that would be enabled on this project.

    A Heroku Procfile is also required.

    opened by bolubee101 0
  • integrated with audd.io as a fall back music matcher

    integrated with audd.io as a fall back music matcher

    This PR integrates the Twitter bot with audd.io's matching APIs. It also expanded the media converter function to cater for different scenarios like the length of the audio snippet to match and the expected output format.

    hacktoberfest-accepted hacktoberfest 
    opened by bolubee101 0
  • Abstract a mention reply function and write a cronjob.

    Abstract a mention reply function and write a cronjob.

    Abstract a mention reply function and write a cronjob that would run every 5 minutes to get all new mentions and call the mention reply function to operate on them.

    opened by bolubee101 0
  • Implement a timestamp parser

    Implement a timestamp parser

    Problem description

    By default, the bot parses the middle 3 seconds of the video to search for a song. But, it is possible for a single video to have more than one song in it at different time stamps, or for some parts of a song to be audibly more distinct than others. Create a functionality that allows a user to add a timestamp when calling the bot. As such: @whatsongishere in mm:ss-mm2:ss2.

    • It is important for the time stamp range to be valid and within the duration of the video.
    • The timestamp range should be a minimum of 3 seconds, but a maximum of 6 seconds.
    • If a start timestamp is passed without an end timestamp @whatsongishere in mm:ss, the end timestamp is taken to be 3 seconds after the start
    • If an end timestamp is passed without an end timestamp @whatsongishere in -mm:ss, the start timestamp is taken to be 3 seconds before the end timestamp.
    • All other input after what has been parsed as the end timestamp can be ignored.
    • Try not to install any new package

    Recommended Approach

    • Create a utility function that parses timestamps if available in the bot tag
    • Move the logic that gets the duration of the tagged video and parses the default time stamps from the convertToRaw function in rawConverter to the utility function just created.
    • The output of the utility function should either be an object in the form:
    {
      "start": "mm:ss",
      "end": "mm2:ss2"
    }
    

    or throw an error due to an invalid timestamp. The error thrown should cause the mention to be saved to the DB(This is important as we don't want the particular mention to be handled again), and a response tweet in the form Sorry @name, it seems you have passed an invalid timestamp.

    • The convertToRaw function should take two new parameters start and end which should be valid timestamps from the utility function you have created.
    hacktoberfest 
    opened by bolubee101 0
  • Javascript audio fingerprinting

    Javascript audio fingerprinting

    An audio fingerprint is a unique characteristic of any piece of audio that can be used by programs to identify the song from a given snippet.

    With that said, I hypothesize that all that we consider music (instrumentals, rap, songs, hymns, etc) have common characteristics in their fingerprints that an ML classifier model can be trained on to be able to differentiate between music and "sound". As I intend to have the entire project written in javascript, I want a function/module that can generate the fingerprint of given audio, which would be plugged into whatever system/module makes use of it.

    opened by bolubee101 0
Owner
Akinwande Akinboluwarin
All round nice guy
Akinwande Akinboluwarin
This plugin can generate timestamps for video, audio and Bilibili video, it takes you to the corresponding video/audio position when clicked.

logseq-plugin-media-ts 本插件能够生成视频、音频以及 B 站视频的时间戳,点击时间戳后会跳转到对应的音视频位置。 This plugin can generate timestamps for video, audio and Bilibili video, it takes

Seth Yuan 58 Jan 3, 2023
This project uses clarfai API to get the characteristic of the images uploaded by the user.

Clarfai Project Introduction In this project we will be using Clarifai's API to show characteristic of the images. The clarifai API is a powerful mach

Sai Charan 3 Mar 20, 2022
🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well with or without a framework.

file-upload-with-preview ?? Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well

John Datserakis 427 Dec 26, 2022
A Twitter bot that tweets all ERC-721 NFT sales for a given contract 🤖

NFT Sales Twitter Bot ?? This was made to succeed my Opensea Sales Twitter Bot repo; while relying on the OpenSea Events API is simpler, it doesn't in

Daniel Griffin 73 Jan 2, 2023
A Twitter bot that reads the tweets of a given username and analyzes the user's personality using AI.

Twitter Chatgpt Analysor Create a bot that reads the tweets of a given username and analyzes the user's personality using artificial intelligence.. In

Sabber Soltani 8 May 9, 2023
A little toy app to help you find the nearest match for a given color within a Figma Tokens color palette.

Hey Palette So you've got a color palette in Figma and you've used the Figma Tokens plugin to export that palette to JSON. Let's say you have a color

Kalo Pilato 5 Nov 15, 2022
This package will generate n numbers of thumbnails at different positions in a given video file.

The smallest library to generate video thumbnails on client side. About Generate n numbers of Image thumbnails of a video file. !Live Demo code sandbo

Rajesh Royal 32 Dec 20, 2022
🎵 simple and RESTful API for getting lyrics of any song made using Next.js and ChakraUI.

playground . guide . discord Overview Lyrist is a simple yet powerful RESTful API for getting lyrics of any song using song name and it's artist name.

ashish 21 Dec 17, 2022
Lorem Ipsum but it's song lyrics 🎵

What is Lyricsum? Lyricsum is a new way to generate placeholder text. It's a website that takes the lyrics of your favorite artists' songs and convert

Anshul Saha 29 Jun 3, 2022
🟢 Music player app with a modern homepage, fully-fledged music player, search, lyrics, song exploration features, search, popular music around you, worldwide top charts, and much more.

Music-player-app see the project here. 1. Key Features 2. Technologies I've used Key Features: ?? Fully responsive clean UI. ?? Entirely mobile respo

suraj ✨ 3 Nov 16, 2022
Incredible drastically simplifies creation of developer video content. It offers a unified workflow to storyboard, record, collaborate and produce the video.

?? Introduction Incredible drastically simplifies creation of developer video content. It offers a unified workflow to storyboard, record, collaborate

Incredible 113 Dec 6, 2022
A simple cli-app that allows you to divide a YouTube video into multiple separate videos base on a video's time stamps. Powered by pkg and yt-scissors library.

YouTube-Scissors CLI A simple CLI app that allows you to divide a YouTube video into multiple separate videos base on a video's time stamps. This proj

Gabe 23 Nov 8, 2022
A browser extension to simplify web pages and hide distracting things like hide cookie banners, auto-playing videos, sidebars, etc

Unclutter Browser Extension A browser extension to simplify web pages and hide distracting things like hide cookie banners, auto-playing videos, sideb

null 849 Jan 9, 2023
This is a tic-tac-toe game but differs from most others as it carries the option of playing against an AI (COM) or against a friend.

TIC-TAC-TOE This is a simple tic-tac-toe game with the exception of playing against an algorithm or against a friend. At the very start, you have to s

Paul Ibeabuchi C. 4 Jul 2, 2022
Api for playing around with dummy data. Feel free to use it in your demo projects, tutorials, or testing tasks.

dummy-api Api similar to dummy-api Api for playing around with dummy data. Feel free to use it in your demo projects, tutorials, or testing tasks. All

Donald Wu 4 Jan 7, 2023
A movie schema sandbox for playing with EdgeDB and the EdgeQL query builder, pre-loaded with MCU data

The EdgeDB MCU sandbox ?? This is a sandbox for playing with EdgeDB and the EdgeQL query builder. It includes a simple movie database schema (dbschema

EdgeDB 13 Nov 9, 2022