Skip to content

Some simple ideas for hacks

Felipe Sant Ana edited this page Apr 25, 2018 · 16 revisions

πŸ‘‹ Welcome to the paratii-js wiki!

Below are some simple ideas for hacks:

1. Youtube Exodus

The goal is to create some code to download a video from the Big Tube and upload it to Paratii 😢. This can become a web-based interface where you can paste a link of a YT video, get boxes to edit metadata if you will, or just go with straightforward mirroring, and get a link for this video on Paratii.

  • 1⃣ Nice extra would be: to be able to paste the link of a channel, and get all (up to 5) video links by mail to you after the work is done.
  • πŸ”Ÿ Bonus points for: have a 2nd step that makes you create an account right there, so you don't have to go to the portal afterwards and secure your keystore.
  • πŸ’― Bonus points for: doing the same with Vimeo.

πŸ’‘ Hint: After you have downloaded the .mp4 file from the Big Tube, you can use paratii.vids.uploadAndTrancode(filePath) to get the transcoded file, and paratii.vids.create({ ipfsHash: hashOfTranscodedFile, title: 'Title from youtube'}) to register the file in paratii. This will return an id, which you can play on https://portal.paratii.video/play/{:id}. Check ParatiiCoreVids.uploadAndTranscode and ParatiiCoreVids.create.

2. Anti-FOMO Telegram (?) Bot

A bot hooked to a server with a Paratii index that notifies you whenever a video you point to has passed 10, 100, 1000 views, and so forth.

πŸ’‘ Hint: use paratii.vids.get(videoId) to get information about the video, including its views.

3. Youtube Mirror Bot

A chat-based bot that gets a Big Tube link, gives you back a Paratii link, and allows you to directly send this link to contacts (in your FB or Telegram friend list).

πŸ’‘ Hint: see point 1 ☝.

4. "Tip widget" for the player

Create a "tip" (a.k.a. "donate") widget for the Paratii player πŸ’Έ

πŸ’‘ Hint: use the paratii.eth.transfer() function for transferring PTI or ETH.

5. Easy "record your desktop and save"

Maybe a desktop or mobile app you just (1) double click the icon; get a play / pause button; record something you do; go back to the icon, pause; simple quicktime-style video trimming; push "upload"; the app stays loading (does all the loop); give you a playable URL for the video on the portal.

πŸ’‘ Hint: use paratii.vids.uploadAndTranscode.

πŸ“² With Toshi

There's under 30 dApps in Toshi as for March-April 2018. One can build a JS bot on top of their SDK and piggyback on an "out-of-the-box" Ethereum (Parity) backend. See "SOFA" protocol.

6. Make the Paratii player playable inside Toshi with WebView

See: https://developers.toshi.org/docs/webview-dapps#section-linking-to-webview-from-a-toshi-app-chat .

πŸ’‘ Hint: our web player is currently developed as part (React) of the portal https://github.com/Paratii-Video/paratii-portal, which is based on a Clappr plugin developed here: https://github.com/Paratii-Video/paratii-mediaplayer

7. Toshi Paratii recommender

Make a bot that can be asked for recommendations; asks back which kind of recommendation; gets the input and matches it with tags (requires functional tags) on the Paratii index; offers a recommendation or two with their links.

πŸ’‘ Hint: we have no tags yet as part of paratii-js 😒

8. Toshi Tipping Bot

Assuming we have a playable player in Toshi, one could make a bot for directly tipping the identity associated with the owner of a given video. I install the bot, and then, whenever I see a Paratii video in Toshi, I can say @bot tip this video with 0.01 ETH, and the bot will get my money and do it.

πŸ’‘ Hint: you can use paratii.vids.get to get the owner of the video, and paratii.eth.transfer (or the native Toshi functions!) to do the actual transfer.

9. Toshi Poolstaker

A bot through which I can pick a video, send a link of it to multiple contacts (the bot does the sending), and then the guys can respond to the bot if they want to stake on that video with me (give it a leap of faith, a bet, a pump, however you name it). The "friends" move funds from their wallet into the bot's wallet, which also gets funds from the original "video sender", and stakes all together, through his address, on the video. The idea is that it'd be able to redistribute earnings periodically, through Toshi (bot collects and does the divisions), or by creating a Paratii account for each user, sending them somehow, and telling them to secure it.

πŸ’‘ Hint: See the TCR / staking documentation here: https://docs.paratii.video/ParatiiEthTcr.html

πŸ’­ Less specific

10. Make an alternative interface for challenging in the propose-challeng mechanism

Bot-based? Some subtle UI? Voice commands (https://github.com/clappr/clappr-speech-control-plugin)? A web-interface just for this?

11. Decentralized object detection on videos

A way for watching new videos registered on chain and searching for patterns in order to aggregate them in tags/lists.

12. Network visualiser

Create a (simple) network visualizer for our ipfs network (showing peers, download speeds, etc). Ideally this is a widget that we can integrate in the player (may be something standalone too).

You can use the API of ipfs-js to get various statistics. The IPFS object is available via the paratii-js library:

 ipfsjs = await paratii.ipfs.start()

The IPFS API is documented here: https://github.com/ipfs/js-ipfs-api#api .