Scheduled Twitter Threads (Scett) – Appwrite x DEV Hackathon



Overview of My Submission

I’ve by no means been a giant Twitter consumer (social media at massive), however that pattern has modified since I found the world of technical writing.

I additionally found that, well timed updates to most companies I exploit are posted on Twitter, when they’re down, again up, asserting new updates and many others.

Additionally, many builders use it to share information snippets (that I discover helpful) and their cool new programming endeavors.

We get your level, it’s the Builders’ city sq., so what’s all this about?

Properly, within the spirit of sharing information, and being impressed by a “at the moment” interest venture that I submitted to the primary Dev Hackathon this yr. I made a decision to arrange a Twitter account that shares Dev Neighborhood content material (quickly so as to add content material from different dev platforms) to the Twitter dev group, primarily newbie content material.

I considered organising a bot to do the posting, however figured, it will lack a human contact as a bot would simply put up the identical rubbish it obtained.

I obtained day by day dev content material per the focused languages arrange on my-daily-reads and would filter them, add a human contact then put up them.

Threads have been a giant assist, however a disappointment as properly.
They’re helpful since I can compile posts then put up them collectively, however the truth that I am unable to schedule them (since I’m generally busy, or lazy) has been a set again.

To counter this drawback, I have been storing drafts on Twitter’s cellular app, then manually put up the threads on the desired time. A really crude hack within the present state of tech.

I’d assume to know why Twitter would not add scheduled tweets as a function, one thing alongside the strains of needing individuals to be actively participating within the platform and scheduled tweets can be antithetical to that mannequin. (Possibly they’ve it unique to blue check-marks? Anyone?)

So, to entice my lazy (or productive) habits, I made a decision to create an app that allows me (and anybody else who’d favor) to schedule Twitter threads.

And what higher means is there to do it than whereas studying a brand new expertise, Appwrite on this case.



Constructing Scett



Organising Twitter

To have the ability to ship Tweets utilizing the Twitter’s API it’s essential register for a Twitter developer account.

After passing by way of the verification course of for making a Twitter Dev account, contained in the developer dashboard add an app and fill within the essential particulars.
Retailer the app id someplace.

Inside your new app add allow OAuth 1.0a consumer authentication settings, select the learn and write permissions as Scett can be posting on behalf of Twitter customers. Retailer the API Key, API Key Secret and Bearer Token someplace protected as we’ll be utilizing them later.

Present the required Callback URI / Redirect URL in addition to the Web site URL, properly be needing the callback URI within the strategy of authenticating customers in Scett.
Within the case of the front-end in [Scett’s Github repo] we’re utilizing – DOMAIN/twauth.

Add different info such because the app’s description and and emblem to assist customers know what it is about.



Setting Up Appwrite

Create a brand new Appwrite venture and add an online platform.



Collections

Add the next collections with the respective attributes.

threads

Title Kind Required
title String true
postTime Integer true
Tweets String[]
userID String true

Permissions:

  • Learn: function:member
  • Write: function:member

 

twitterInfo

Title Kind Required
deal with String true
token String true
id String
userID String true

Permissions:

  • Learn: function:member
  • Write: function:member

 



Capabilities

Add two features and create api keys for them respectively.

The features code is included inside the venture’s repository.



Twitter Oauth

This operate can be used within the Twitter’s oauth 3-legged movement for consumer authentication.
Its API key solely wants the execute permission.
Add the next environmental keys to this operate.

  • ENCRYPTION_SECRET – a 32 character String which can act because the salt to encrypting our consumer tokens. We can be encrypting the tokens earlier than saving them to the twitterInfo assortment.
  • TW_OAUTH_FUNCTION_API_KEY – Api key we generated for this operate.
  • TWITTER_AUTH_REDIRECT_ENDPOINT
  • TWITTER_API_KEY – Obtained from out twitter app.
  • TWITTER_API_KEY_SECRET – Obtained from out twitter app.


Tweets Envoyer

This operate can be used within the Twitter’s oauth 3-legged movement for consumer authentication.
Its API key wants doc learn and proper and performance execution permissions.
Add the next environmental keys to this operate.

  • ENCRYPTION_SECRET – Similar as above
  • TW_ENVOYER_FUNCTION_API_KEY – Api key we generated for this operate.
  • TWITTER_API_KEY – Similar as above
  • TWITTER_API_KEY_SECRET – Similar as above
  • TWITTER_INFO_COLLECTION_ID – Assortment id of our twitterInfo assortment
  • APPWRITE_ENDPOINT – Endpoint of our appwrite venture
  • APPWRITE_PROJECT_ID – Mission id of our appwrite venture

Configure the cron job to run after a sure time period that is not more likely to violate the twitter API limits. For Scett I’ve set this to each 5 minutes, thus the threads can also solely be scheduled in steps of 5 minutes all through the day.

Scett Functions



Entrance Finish

Scett’s Entrance-end is made in Vue3, utilizing the src script sugar.
Clone it from github:

git clone https://github.com/xinnks/scett.git
Enter fullscreen mode

Exit fullscreen mode

cd into it and run npm set up in your terminal.



Submission Class:

Web2 Wizards



Hyperlink to Code

Right here is Scett on github.

Scett helps you schedule your twitter threads.

Scheduled Twitter Threads

 

Powered By



Extra Sources / Information

Scett is powered by the next open supply initiatives.

 



Screenshots/demo movies

Home Page

Image description

Dashboard Page

Viewing Tweets



Add a Comment

Your email address will not be published. Required fields are marked *