GithubHelp home page GithubHelp logo

blankoworld / dofus-almanax Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 1 MB

Create an web page with next 30 days almanax quests in Dofus

Home Page: https://almanax.o9.re/

Python 70.67% CSS 20.39% Dockerfile 6.48% Makefile 1.06% Shell 1.40%
static dofus almanach

dofus-almanax's Introduction

Version française un peu plus bas.

Dofus almanax for the 15 next days

This script give a HTML code that display the 15 next days of Dofus almanax.

You can see result here: Almanax.

LICENSE: This program is under WTFPL conditions (Cf. https://en.wikipedia.org/wiki/WTFPL).

Dependencies

You need:

  • python3
  • python-lxml
  • python-mechanize

Installation

No installation needed

How to use it?

On command line

In a shell, just do this:

cd src
python almanax_next_week.py > index.html

This will build an index.html file with the 15 next days of almanax.

With docker-compose

If you install Docker Compose on your computer, just do:

docker-compose up

The website would be accessible on: http://localhost:8888/.

Tip

You can use a CRON job on GNU/Linux to often build the page.

Example that launch the script every day at midnight:

30  0  *   *   *     /usr/bin/python /srv/web/almanax/almanax_next_week.py > /srv/web/almanax/www/index.html

Almanax Dofus des 15 prochains jours

Ce script renvoie un code HTML qui affiche les 15 prochains jours de l'almanax Dofus.

Vous pouvez voir le résultat ici : Almanax

LICENCE : Cette application est délivrée sous les conditions de LPRAB (Cf. https://fr.wikipedia.org/wiki/WTFPL)

Dépendances

Vous avez besoin de :

  • python3
  • python-lxml
  • python-mechanize

Installation

Aucune installation nécessaire

Comment l'utiliser ?

En ligne de commande

Dans une console, faites simplement ceci :

cd src
python almanax_next_week.py > index.html

Cela va construire une page index.html avec les 15 prochains jours de l'almanax.

En utilisant des conteneurs Docker

Si vous avez installé Docker Compose sur votre machine, il suffit de faire :

docker-compose up

Le site est accessible à l'adresse suivante : http://localhost:8888/.

Astuce

Vous pouvez utiliser une tâche CRON sur GNU/Linux pour construire la page régulièrement.

Exemple qui lance le script tout les jours à minuit:

30  0  *   *   *     /usr/bin/python /srv/web/almanax/src/almanax_next_week.py > /srv/web/almanax/src/index.html

dofus-almanax's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

githork

dofus-almanax's Issues

Ajouter en paramètre le répertoire dans lequel écrire le résultat

Étant donné que le programme génère du code HTML, il serait intéressant de donner en paramètre un répertoire dans lequel écrire le résultat.

python2 almanax_next_week.py pub/

Et cela ferait un fichier index.html dans le dossier pub. Ou bien index.html.en et index.html.fr dans le dossier pub (pour avoir la version anglaise et la version française de l'Almanax).

Génération aléatoire d'un fond d'écran différent à chaque utilisation du script

  • ajout des fichiers .jpg dans un dossier img
  • ajout d'un paramètre pour activer la génération aléatoire du fond d'écran
  • mettre le paramètre à True
  • générer le fond (et le copier à la racine du script) puis modifier le fichier CSS (template String de Python) pour afficher ce fond
  • adapter la documentation pour expliquer comment désactiver cela
  • ajout d'un paramètre "image par défaut", lorsque la génération aléatoire est désactivée

Générer la version française ou anglaise suivant un paramètre

Il serait judicieux d'avoir une version anglaise de l'Almanax.

Soit on génère une et une seule version en fonction d'un paramètre, soit on génère les deux versions et on inclue des liens entre les deux.

Sur un site web, l'idéal est d'avoir les 2 versions et de proposer suivant la locale de l'utilisateur, ce qui peut être fait avec Apache2 par exemple (et des pages html.en et html.fr) ou bien avec Nginx et une petite astuce :

dans nginx.conf on ajoute ça :

map $http_accept_language $lang{
  default en;
  "~fr" fr;
  "~en" en;
}

puis dans la configuration du site lui-même :

index index.html.$lang index.html index.htm;

location / {
try_files $uri.$lang $uri $uri/ /index.html;
}

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.