Uni-Server is a Node.js application that leverages OpenAI's ChatGPT and DALL-E 3 for content creation. The server can publish this content to various social media platforms (LinkedIn, Facebook, Instagram, and Twitter) and create blog posts for HubSpot using ChatGPT. It also utilizes the News API to generate posts with content curated by ChatGPT.
- Content creation using ChatGPT and DALL-E 3
- Publishing to LinkedIn, Facebook, Instagram, and Twitter
- Blog post creation for HubSpot
- Content generation using News API
- Clone the repository:
git clone https://github.com/yourusername/Uni-Server.git
- Navigate to the project directory:
cd Uni-Server
- Install dependencies:
npm install
- Create a
.env
file in the root directory and add your API keys and other configurations. Here's a template for the.env
file:MONGODB_URI=mongodb://127.0.0.1:27017/test OPENAI_API_KEY= PRIVATE_APP_ACCESS= LINKEDIN_CLIENT_ID= LINKEDIN_CLIENT_SECRET= LINKEDIN_TOKEN= LINKEDIN_ORG_ID= LINKEDIN_MEMBER_ID= TWITTER_API_KEY= TWITTER_API_SECRET= TWITTER_BEARER_TOKEN= TWITTER_API_SECRET_NON_CONSUMER= TWITTER_CLIENTID= TWITTER_CLIENT_SECRET= FACEBOOK_ACCESS_TOKEN= FB_PAGE_ID= FACEBOOK_ACCESS_TOKEN_CGI= FB_PAGE_ID_CGI= IG_ID= IG_ID_CGI= NEWS_API_KEY= CLOUDINARY_CLOUD_NAME= CLOUDINARY_API_KEY= CLOUDINARY_API_SECRET= TWITTER_API_KEY_CGI= TWITTER_API_SECRET_CGI= TWITTER_BEARER_TOKEN_CGI= TWITTER_API_KEY_NON_CONSUMER_CGI= TWITTER_API_SECRET_NON_CONSUMER_CGI= TWITTER_CLIENTID_CGI= TWITTER_CLIENT_SECRET_CGI=
Start the server with:
npm run dev
The server will be available at http://localhost:8080
.
- Go to the LinkedIn Developer portal and create a new application.
- Set the redirect URI to
http://localhost:8080/auth/linkedin/callback
. - Note the Client ID and Client Secret and add them to your
.env
file. - Follow LinkedIn's OAuth 2.0 flow to get the access token.
- Go to the Facebook for Developers site and create a new app.
- Set up Facebook Login and add the redirect URI as
http://localhost:3000/auth/facebook/callback
. - Note the App ID and App Secret and add them to your
.env
file. - Follow Facebook's OAuth 2.0 flow to get the access token.
- Go to the Facebook for Developers site and create a new app (if you don't have one from Facebook setup).
- Set up Instagram Basic Display and add the redirect URI as
http://localhost:3000/auth/instagram/callback
. - Note the App ID and App Secret and add them to your
.env
file. - Follow Instagram's OAuth 2.0 flow to get the access token.
- Go to the Twitter Developer portal and create a new application.
- Set the redirect URI to
http://localhost:3000/auth/twitter/callback
. - Note the API Key and API Secret Key and add them to your
.env
file. - Follow Twitter's OAuth 2.0 flow to get the access token.
Tip
- Go to the HubSpot Developer portal and create a new app.
- Note the API Key and add it to your
.env
file.
- Go to the News API website and sign up for an API key.
- Add the API key to your
.env
file.
Once the server is running, it will automatically handle content creation and posting based on the configured APIs. Refer to the individual API documentation for specific usage and capabilities.
Created by: @frozzel
Please contact me with questions at: @frozzel
Note
Helpful articles for basic concept under standings: Medium Article && DEV Article
-
Copy link below into Browser (first add client id from app for developer or env file)
THE LINK WILL ASK FOR PERMISSION FROM YOUR LINKED IN ACCOUNT, SIGN IN AND HIT ALLOW, IT WILL REDIRECT YOU TO A BLANK PAGE YOU NEED THE CODE IN THE URL OF THIS BLANK PAGE FOR THE NEXT STEP
Example https://www.linkedin.com/developers/tools/oauth/redirect?code=YOU NEED THIS
-
Open POstMan, go to linked in collection, post to access token end point and add the Token to the Body code section
Tip
THis will be the two month auth code needed to post.
Note
Helpful articles for basic concept under standings: FACEBOOK API DOCS && META API DOCS
- "CYRUS BLOG POSTER" Go To graph API Explorer, Hit Generate Access Token to reauthorize user first, submit the GET request to verify its working. Save Token, Next Select Page Token and do the same as above now submit with the page token to verify page access.
Caution
THIS ONLY LAST AN HOUR
example:
{
"id": "RANDOIDNUMBER IS HERE",
"name": "Cyrus Group Innovations"
}
-
GET LONG LIVE TOken
curl -i -X GET "https://graph.facebook.com/v20.0/oauth/access_token?
grant_type=fb_exchange_token&
client_id={app-id}& client_secret={app-secret}& fb_exchange_token={your-access-token}"Get the api ID and app-secret in the app dashboard and the secret will be under App settings Basic. Take the above curl and add the three codes obtained to it in a text editor. copy the curl into your terminal to receive your long live token.
Warning
Expires 60 DAYS
By following these instructions, you'll be able to set up and run the Uni-Server to create and publish content across multiple platforms seamlessly. If you encounter any issues, please refer to the documentation or open an issue on GitHub.
Authorization: Bearer OPENAI_API_KEY
https://platform.openai.com/docs/api-reference/introduction
npm install openai@^4.0.0
π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯