Coder Social home page Coder Social logo

article-maker's Introduction

Article Maker

An implementation of an article maker system with a CLI tool to fetch comments with a supplied URL and an API for articles.

Getting started

Clone the repository

git clone https://github.com/Lumexralph/article-maker.git

Change into the directory

cd uconv

Install all the necessary packages, run

go mod tidy

Build and install the tool in your computer

go install .

article-maker gets added as a binary in your computer and you can start using it.

It gives you access to 2 tools;

  1. lwc - lowest common words in a list of comments

     article-maker lwc --url https://jsonplaceholder.typicode.com/comments
    

    a json reponse gets printed to the stdout or the terminal like below

     [
             {
                     "word": "amet",
                     "count": 24
             },
             {
                     "word": "ducimus",
                     "count": 31
             },
             {
                     "word": "dolore",
                     "count": 35
             },
             {
                     "word": "assumenda",
                     "count": 35
             }
     ]
    
  2. server - this handles the article maker api. Start the server using the following command as below

     article-maker server --port 5000  // you can supply any port of choice
    

Then you have access to the following endpoints or URL

Feature Method URL Payload
Create an article POST /article { "title": "Game of thrones", "body": "Lorem ipsum dolor sit amet, "category": "Commercials", "publisher": "John Wale", "created_at": "2006-01-02T15:04:05+07:00", "published_at": "2006-01-02T15:04:05+07:00" }
Get all articles GET /article
Update an article PUT /article {"id" : 5, ... POST payload}
Get a specific article by id GET /article/:id
Delete a specific article DELETE /article/:id

For the api, you'll need a postgres database with an env. file

Documentation on the code

Run:

godoc --http=:8080  // visit the URL in the browser

To run tests, run:

go tests // in any package with test file

Errors and bugs

If something is not behaving intuitively, it is a bug and should be reported. Report it here by creating an issue: https://github.com/Lumexralph/article-maker/issues

Copyright (c) 2020 LumexRalph. Released under the Apache License.

article-maker's People

Contributors

lumexralph avatar

Watchers

 avatar

Forkers

ibrahimandela

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.