Giter Site home page Giter Site logo

autociencia / summaryze Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 671 KB

A script to generate summary for blogspot articles.

License: GNU General Public License v3.0

Python 22.74% HTML 8.56% JavaScript 1.41% TypeScript 62.47% Dockerfile 0.90% SCSS 3.92%
python blogspot blogger summary

summaryze's Introduction

Summaryze

Summaryze icon A web solution to generate summary for blogspot articles. You can try it online here.

ℹ️ How it works

Front-end receives an URL and send it to back-end. The front-end was made with TypeScript. Back-end receives the URL and pass it to its API, it validates, process and (if valid) returns the generated HTML code of summary from that URL to front-end. Back-end was made in Python with Flask.

Note: article needs to have at least title (h1, h2, h3, h4, h5 or h6).

ℹ️ How to use

First, visit a blog from Blogger.

Second, copy the URL of a post.

Then, paste the URL in the input box on app and click on search. Tutorial Usage - Summaryze

Below, the search box has a link example. You may use it to test the app. Result: Tutorial Usage - Summaryze

▶️ How to run

You need to some tools:

📋 Clone

$ git clone https://github.com/autociencia/summaryze.git
$ cd summaryze

🔧 Setup Python

After clone and enter in summaryze project, create a virtual environment:

$ python3 -m venv env

Active it:

$ . env/bin/activate

Install Python dependencies:

$ pip3 install -r requirements.txt

🔧 Setup TypeScript

After clone and enter in summaryze project, install Node dependencies:

$ npm install

▶️ Run

After install all dependencies, simply:

$ ./run.py

Then, enter on http://localhost:5000.

💉 Tests

To test the API, enter into summaryze module (it contains __init__.py file) and run:

$ python -m unittest discover

🛠️ Build

To build TS files, enter in summaryze project and run:

$ grunt

🐳 Docker

You can run this app using Docker. Enter on project and run (as superuser):

# Old way to build:
docker build -t summaryze:latest .
# New way to build:
docker buildx build --tag summaryze:latest .

docker run --name summaryze -d -p 5000:5000 summaryze:latest
docker ps

You may omit -d argument to run this app as non daemon and see server logs on terminal.

🌐 Technologies

Front-end was developed using:

Back-end was developed using Python with Flask Framework.

📐 Architecture

Summaryze was designed in MVC pattern.

Python

Summaryze module has structured as:

  • 📚 api: contains the core application that generate summaries (model).
  • 📊 templates: are HTML pages where the summary will be displayed (views).
  • 🔀 routes.py: controllers that handle requests and serves its responses with model binding in view.
  • ⚙️ config: app configuration. You need to generate a new SECRET KEY to production usage.
  • 📄 static: static files like images, favicons, CSS, JS...
  • 💉 tests: unit tests for Python code.
  • ▶️ __init__.py: initialize the Flask App.

TypeScript

TypeScript files are located in static/summaryze/ts. TypeScript structure:

  • 🛠️ builder: contains classes with builder pattern.
  • 💾 cache: classes that manipulate data from browser session.
  • 🔀 controllers: bind models on views.
  • 📚 data: contains all summary styles.
  • 🎆 events: where the logic is performed to do something on page.
  • 🔗 http: makes http ajax requests.
  • 📃 models: where Summary and Style are located.
  • 📤 utils: to aggregate reusable functions.
  • 📊 views: where models are displayed.
  • ▶️ app.ts: is the main file; it initializes the TS app.

Final Considerations

Currently, Blogger doesn't has a tool to generate summary for articles on its platform. So, we did it ourselves.

We developed Summaryze in Python for command line (CLI). But we seen the possibility to expand the App to other people who have the same problem. So, is that. You can use the API from command-line using python3 -m summaryze <<URL>> on dir /api. The API was designed standalone from project.

Roadmap

  • Expand project to Medium, Wordpress and others.
  • Possibility to generate summary from other sources (like directly or via files)
  • Port SASS to Node dependencies.

summaryze's People

Contributors

cledersonbc avatar

Stargazers

 avatar  avatar  avatar  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.