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
ย 
hajusef_908 profile image
Hajeem Usef โ€ข

Nice one Nevo!

Collapse
ย 
james0123 profile image
James โ€ข

How did you create that cover image?

Collapse
ย 
justinwells21 profile image
justinwells21 โ€ข

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

Collapse
ย 
arindam_1729 profile image
Arindam Majumder โ€ข

Great One!

Collapse
ย 
nathan_tarbert profile image
Nathan Tarbert โ€ข

Great article Nevo!

Collapse
ย 
madeinmilwaukee profile image
Chuck Watson โ€ข

Cool, more AI spam on the internets. Good job