Giter Club home page Giter Club logo

text_source_restful_api's Introduction

Table of Contents

What is Tweet Generator API?

An awesome project that users can post/get/delete/update text sources such as stories, speeches etc.

ADDITIONALLY, it can generate a sentence based on Markov chain for any of these text sources.

(thus making it a tweet generator considering each generated sentence as a tweet.)

baseURL: https://text-source-api.herokuapp.com

Example Project:

Predicts and generates a tweet that Donald Trump could tweet using Markov Chain based on corpus of all his past speeches (168k+ words). Website: www.donald-trump-tweet-generator.herokuapp.com/ (New sentence each refresh) Markov Chain Algorithm: https://github.com/ruhsane/Tweet-Generator-OOP

Documentation

Authentication

Signing up

post('https://text-source-api.herokuapp.com/sign-up', {
    username,
    password
})

Successful Response:

{
    "token": "thisxxxis.axxxjson.webxxxtoken"
}

Login

post('https://text-source-api.herokuapp.com/login', {
    username: String
    password: String
})

Successful Response:

{
    "token": "thisxxxis.axxxjson.webxxxtoken"
}

Authorized Routes

Get all text sources

get('https://text-source-api.herokuapp.com/text_sources', {
})

Successful Response:

{
[
    {
        "_id": "id",
        "title": "title",
        "Created_date": "2019-03-05T05:07:09.420Z",
        "content": "blah blah"
    },
    {
        ...
    }
]
}

Upload a text file

post('https://text-source-api.herokuapp.com/text_sources/new', {
    title: String,
    content: txt file    
})

Successful Response:

{
    "_id": "id",
    "title": "title",
    "Created_date": "2019-03-09T11:17:38.067Z",
    "content": "blah blah",
    "__v": 0
}

Read a single text source

get('https://text-source-api.herokuapp.com/text_sources/:sourceId', { 
})

Successful Response:

{
    "_id": "id",
    "title": "title",
    "Created_date": "2019-03-05T05:07:09.420Z",
    "content": "blah blah"
}

Update a text source

put('https://text-source-api.herokuapp.com/text_sources/:sourceId', { 
    title: String,
    content: String
})

Successful Response:

{
    "_id": "5c83a1f87afd960024cb0c13",
    "title": "new title",
    "Created_date": "2019-03-09T11:22:32.851Z",
    "content": "new content",
    "__v": 0
}

Delete a text source

delete('https://text-source-api.herokuapp.com/text_sources/:sourceId', { 
})

Successful Response:

{
    message: "Text source successfully deleted"
}

Markov Sentence For a Text Source

Markov Chain algorithm implementation: https://github.com/ruhsane/Tweet-Generator-OOP
get('https://text-source-api.herokuapp.com/text_sources/:sourceId/get_markov', { 
})

Successful Response:

"generated text by markov chain"

text_source_restful_api's People

Contributors

ruhsane avatar

Watchers

James Cloos avatar

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.