Giter Site home page Giter Site logo

hxalid / frequencify Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

This is a hobby project I wrote in 2019. It is a cli tool to scrape Wikipedia API and print top N words on a given page.

License: MIT License

Dockerfile 4.48% Makefile 8.72% Go 86.81%

frequencify's Introduction

Wiki Crawler

A cli tool to scrape Wikipedia API and print top N words on a given page.

Dependencies

  • Cobra - a Go cli library
  • Testify - A toolkit with common assertions and mocks that plays nicely with Go standard library.
  • Package errors - Package errors provides simple error handling primitives.
  • Go 1.12 - required due to Go modules.

Note:

  • This application could have been written without depending on any external libraries. Especially using Cobra may sound like an overkill for two parameters.
  • It has been tested by using Go 1.12 on macOS Mojave and Linux Mint 18.
  • It should work on Go 1.11 as it supports Go modules as well.
  • If you don't have Go 1.11+ please use the Docker build

How to run

The project includes a Makefile with the following rules:

all                            Build and run tests
clean                          Remove previous build
docker                         Containerise the application
help                           Display available commands

To build it for your desired architecture only, please specify the architecture name to the make command. For instance to build it only for MacOS run the following command:

make darwin

The following steps are needed in order to run the application from a Docker container:

  • make docker or docker build -t frequencify .
  • docker run -it frequencify:latest -n <number> -p <pageid>

How to test

The default Makefile target runs unit tests after successful build.

To exacute the command on MacOS run the following command:

./frequencify_darwin_amd64 -n 5 -p 21721040

Here -n indicates the top n words and -p indicates the page id. The application provides -h help option as well.

frequencify's People

Contributors

hxalid avatar

Watchers

 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.