Skip to content

Example Ruby on Rails app showing how to build an AI-powered smart feed of content using Fuzzy.ai and Twitter

Notifications You must be signed in to change notification settings

fuzzy-ai/smart-feed-example

Repository files navigation

README

Example Rails application for a "tweet relevance" agent using https://fuzzy.ai/

Configuration

The application integrates with both the Twitter API and the Fuzzy.ai API. You will need accounts and configuration options from both. The app is configured through environment variables.

Create a twitter application

  • Visit apps.twitter.com, sign in and click "Create New App".
  • Complete the form with appropriate values, then click on "Keys and Access Tokens"
  • From the "Application Settings" section under the Keys and Access Tokens tab, copy the following environment variables:
    • "Consumer Key (API Key)" as TWITTER_CONSUMER_KEY
    • "Consumer Secret (API Secret)" as TWITTER_CONSUMER_SECRET
  • From the "Your Access Token" section, copy the following values:
    • "Access Token" as TWITTER_ACCESS_TOKEN
    • "Access Token Secret" as TWITTER_ACCESS_SECRET

Create a Fuzzy.ai Agent

  • If you haven't done so already, create an account at https://fuzzy.ai/signup and log in.
  • From your fuzzy.ai dashboard, copy your api key to the environment variable FUZZY_API_KEY.
  • Visit https://fuzzy.ai/agents/new/tweet-relevance and click "Create".
  • Copy the agent ID from the newly created agent to the environment variable FUZZY_AGENT_ID

Deploy

Heroku

Deploy to Heroku

After clicking the button above, you will be prompted for the configuration variables from the previous section.

Docker Cloud

Before you deploy to Docker Cloud, make sure you have an account and are logged in: at https://cloud.docker.com/

Deploy to Docker Cloud

After clicking the button above, you will have an opportunity to edit the with the values from the previous section.

Local installation

Requirements

  • Ruby >= 2.2.2 (Use rvm to get recent ruby versions)
  • Bundler (gem install bundler)
  • Postgresql

Steps

  1. Clone the repository
  2. Run bundle install
  3. Run bundle exec rails db:create
  4. Create a .env based on env.sample (cp env.sample .env)
  5. Run bundle exec rails server
  6. Load the site at http://localhost:3000/

About

Example Ruby on Rails app showing how to build an AI-powered smart feed of content using Fuzzy.ai and Twitter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published