Helps users to get the articles published in NewYork Times newspaper from September, 1851 to last month. The news articles are extracted from NewYork Times through APIs will be used for data-processing and NLP (as per your requirements). This project is built using Go (GoLang) web framework Gin
and MySQL.
- Install Go programming language (Go or GoLang).
- Install any code editor or IDE which has support for Go.
- Install all dependency packages using
go get
.go get -u github.com/gin-gonic/gin
go get -u github.com/jinzhu/gorm
go get -u github.com/go-sql-driver/mysql
go get golang.org/x/crypto/bcrypt
- Install
MySQL
orMariaDB
- (Both will act like same). - Configure MySQL/MariaDB with a username and password.
- Create a database inside the MySQL which is needed to run go http server.
- Configure NY API (nytimes) credentials in
configurations/static/nyapiconf.json
file.
- Download and install
MariaDB
orMySQL
. - Create an user with a strong password.
- Create a database with a suitable name.
- Update the database configuration file with the username and password.
- Create a email-id from any email service.
- Grant permission to the email to use it from any 3rd party application.
- Update the email configuration file.
- Run Application.
- Format:
go run <filename>.go
- Example:
go run main.go
- Format:
- Build Application with dependencies (Creates executables).
- Format:
go build <filename>.go
orgo build
- Example:
go build main.go
- Format:
- POST /api/v1/user/register
- POST /api/v1/user/login
- GET /api/v1/user/logout
- GET /api/v1/user/details
- GET /api/v1/archive/details/:year/:month
- Register an user with
/api/v1/user/register
API call. - Login with the registered user details,
/api/v1/user/login
API call. - You will get Auth Token when login.
- Set the auth token request header
Authorization: Bearer YourToken
for all API calls, after login. - API call
/api/v1/user/details
is for getting the details of logged in user. - To get the list of all articles link and details for a particular year and month call
/api/v1/archive/details/:year/:month
API. - To logout from the application, use
/api/v1/user/logout
API call.
- Don't fotgot to change the configurations for the application in
configurations
directory. https://golang.org/dl/
https://code.visualstudio.com/#alt-downloads
https://downloads.mariadb.org/
https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them
This software is licenced under GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007.