DEV Community

Cover image for The project I built with the Twitter API, GPT4 & CopilotKitβ€¦πŸš€πŸ§‘β€πŸ’»

The project I built with the Twitter API, GPT4 & CopilotKitβ€¦πŸš€πŸ§‘β€πŸ’»

Nevo David on August 08, 2024

TL;DR Last week I built an application that automates my social media posting using AI. I will show you how I did it. We will cover ho...
Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ • Edited

Genuine questions:

Why would you have AI generate your content for you? What possible benefit is there in that for anyone (other than helping to fill the internet with more AI generated junk)?

Also, is 'Coppiotkit on Githhub' the same as 'CopilotKit on Github'? 😜
Generated image fail

Collapse
 
welshapple profile image
William

😱 😱 😱 😱 😱 sounds like someone doesn't want to 10x their posts on twitter 😱 😱 😱 😱 😱

Do you not even AI bro ?

πŸ€–πŸŽƒ 🀠😈 Here's 3 projects I'm working on to help speed up productivity πŸ€–πŸŽƒ YOU WONT BELIEVE NUMBER 2 (im shoving open AI coppiotkit straight up my ass) πŸ€–πŸŽƒπŸ€–πŸŽƒ 🀠😈

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ

πŸ˜‚

Collapse
 
derekmurawsky profile image
Derek Murawsky

I'm torn... This was actually a really good article... but the goal and title, not so much. Why on earth would you want to 10x your posts with crap AI content? That's part of the whole problem with how AI is being used right now.

Collapse
 
trevorbenson profile image
illuminatus • Edited

I think this is a great walkthrough on how to setup and integrate a project with Twitter API and their OAuth 2.

I do have a few comments though.

  1. In the npx create-next-app social-media-scheduler step for Would you like to use /src directory? question you show Yes. Throughout the rest of the example steps this is never used or suggested the user move into src before following additional steps, maybe that was not used in your setup as multiple steps later don't seem to account for a ./src directory. For example:

    • During section The Dashboard Page the user would still inside social-media-scheduler directory:
     cd app
     mkdir dashboard && cd dashboard
     touch page.tsx
    
  • During section Authenticating users via X it also leaves out the ./src directory. However, the user's terminal would still be inside ./src/app/dashboard from prior step of making page.tsx, no step moved back to social-media-scheduler and the start of this section does not suggest starting a terminal from the project root again.

     cd app
     mkdir api && cd api
     mkdir twitter && cd twitter
     touch route.ts
    
  1. During section The Dashboard Page the user is instructed to create a utils file, not a util.ts file:
    • src/app/dashboard/page.tsx: import { availableSchedule } from "../util";
    • src/app/components/App.tsx: import { formatTime, tableHeadings } from "@/app/util";
    • src/app/page.tsx: import { getTwitterOauthUrl } from "@/app/util";

Naming it either utils, or util leads to errors in npm run dev causing the site to not work and no Sign in with Twitter button to be accessible.

I think resolving these very small oversights would allow a complete novice to follow your post, remove any confusions about paths, and any compilation errors they would otherwise run into.

Even with these minor issues I still think its a worthwhile read and a good walk through. Thanks for the article!

Collapse
 
ivictbor profile image
Ivan Borshchov

This is awesome, man!!!

Collapse
 
uliyahoo profile image
uliyahoo

πŸ”₯πŸ”₯πŸ”₯

Collapse
 
james0123 profile image
James

How did you create that cover image?

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

Great article Nevo!

Collapse
 
justinwells21 profile image
justinwells21

Really nice tutorial, but don't love the title.

Collapse
 
arindam_1729 profile image
Arindam Majumder

Great One!

Collapse
 
time121212 profile image
tim brandom

Nice one Nevo!

Collapse
 
madeinmilwaukee profile image
Chuck Watson

Cool, more AI spam on the internets. Good job