Giter VIP home page Giter VIP logo

ainews's Introduction

AI News

image

Prerequisites

Before running this application, ensure you have Node.js installed on your system.

Article Generation

The main line code for scraping and then generating news articles with GPT4 is in newsGen.js

Simply setup your API key envars (see below) and then run newsGen.js to generate a news article on demand

Website Installation

Follow these steps to set up the Imaginary Chat Application:

  1. Clone the repository:
git clone https://github.com/BigOtis/ainews.git
cd ainews
  1. Install the dependencies:
npm install
  1. Set up the OpenAI API key:

  2. Create a .env file in the root of the project directory, and add your OpenAI API key and a MongoDB key:

API_KEY_VALUE=your_api_key_here
MONGO_URL=your_mongo_url_credentials

Replace your_api_key_here / your_mongo_url_credentials with your actual OpenAI / MongoDB API key.
Running the application
  1. Start the development server:
npm run server

This command will start the server required for the OpenAI API integration. Keep this terminal window open.

  1. In a new terminal window, start the React development server:
npm start

This command will open the news webpage. The application should be running on http://localhost:3000/.

Now, you can generate an AI perspective on the latest news with the click of a button.

To generate new articles to populate your database, run the newsGen script standalone:

node server/util/newsGen.js

ainews's People

Contributors

bigotis avatar

Stargazers

José Wenceslao Castillo avatar  avatar Scrolli avatar Egemen avatar Nate Geslin avatar  avatar Michael Adame avatar  avatar

Watchers

 avatar

ainews's Issues

[nodemon] app crashed - waiting for file changes before starting...

Hello, first of all i appreciate your great effort to make this beautiful website available. I have zero coding experince, that's why when i see an error, i think the worst. Anyways, i pasted the mongo URL, chatgpt API key, however i got this error. Do you know what could be the reason? I made 4 hours research to fix that.

TypeError: Cannot read properties of undefined (reading 'startsWith')
at connectionStringHasValidScheme (/Users/nihat/ainews/node_modules/mongodb/node_modules/mongodb-connection-string-url/lib/index.js:9:30)
at new ConnectionString (/Users/nihat/ainews/node_modules/mongodb/node_modules/mongodb-connection-string-url/lib/index.js:85:34)
at parseOptions (/Users/nihat/ainews/node_modules/mongodb/lib/connection_string.js:191:17)
at new MongoClient (/Users/nihat/ainews/node_modules/mongodb/lib/mongo_client.js:48:63)
at Object. (/Users/nihat/ainews/server/controllers/articleController.js:5:16)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.