Giter Site home page Giter Site logo

hec's Introduction

HEC - Html Export Compiler

This is essentially just a build script written in BASH-script. It compiles together the HTML export for an OSF document which resides at a ShowPad.

In order to do so, it requires a parameter $padname to be specified upon invocation. It invokes the specified pad's content, calls the parser of SimonWaldherr to parse the content, and prepends the HEADER data. Additionally it sorts the resulting file into the shownot.es "podcasts" directory and calls the browser to present the HTML file.

Dependencies

Mainly GNU Linux. Most notably GNU bash, followed by GNU sed, GNU dc, and a lot of other commands which are shipped with a GNU Linux distro. I use the default Ubuntu to run the script. Trying to run the script on a Mac will probably fail, due to that the implementations of grep, sed, dc, and mktemp (among others) differ.

License

GNU GPL version 3.

Setup

HEC requires the shownot.es Repository which can be found under shownotes/shownot.es.

HEC comes with a config file .hec_config. You can set the path to where you put the shownot.es directory right after out_dir=. The line include= is only relevant, when you don't have all the HEC's files in one directory, or if you are running hec.sh from a different directory (such would also be the case, if you did put it into a sub folder). The other configuration options don't need to be altered for the script to run.

Example setup configuration:

I have my script at /home/quimoniz/github/hec/hec.sh the other HEC files are also in that directory, my shownot.es directory is at /home/quimoniz/github/shownot.es so I put in my configuration file:

include=./
out_dir=../shownot.es/

If I fancy to run hec.sh from within my shownot.es directory, I should instead use absolute paths:

include=/home/quimoniz/github/hec/
out_dir=/home/quimoniz/github/shownot.es/

Previous to this release HEC was distributed as utilsh.tar.gz, which was put in a sub folder of the shownot.es directory. It is still possible to set up HEC the old fashioned way. In order to do so, it is good practice to use absolute paths in the config file as mentioned above, like so include=/home/quimoniz/github/shownot.es/.utilsh/. Note, that in this case you will also have to add .hec_config to the .gitignore file in your shownot.es directory.

Usage

Once set up, just invoke it with a pad name. For example bash hec.sh einschlafen-230.

The script then requests the pad's contents, parses them, assumes a path name for the HTML output, writes to to it, and invokes the browser to present a preview.

Note that you may also specify an additional parameter --preview which adds a warning label to the output, stating that it is still in revision.

Security Considerations

Bwahahahahaha

I assume it can be easily exploited by inserting code into the external text source. However, I will give out a reward of 20 Euros to anyone who can first show a particular vulnerability, and tell me how to fix it.

Reference

The script won't do anything if the OSF has no HEADER

header fields:

namenecessarydescription
podcastmandatoryname to use for looking up the podcast's "slug"
episodemandatoryonly used to figure out the episode number
podcastermadatorylist of podcasters, will be passed to "form-userlist.sh"
shownotermandatorylist of shownoters, will be passed to "form-userlist.sh"
starttimeoptionalfor header field "Sendung vom"
actual-starttimeoptionalmay override "starttime" if specified
webseiteoptionalthe podcast's web page
episodepageoptionalthe specific episode's page
episodetitleoptionalthe specific title of this particular episode
chatlogdeprecatedan optional link to a chat log, as has been used for NSFW (has to be enabled in config)

hec's People

Contributors

quimoniz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

vale

hec's Issues

HTTPS-kompatible Links erzeugen

Alle Links zu Bildern oder Logos sind direkt zu http://google.com verlinkt. Wenn die Seite via HTTPS geladen wird, erzeugt das Warnungen. Das gilt auch für interne Links auf der Seite, zB zu einer Episode.

Lösung: Links durch //google.com ersetzen.

fix recognition of wrint

When parsing shownotes of Lauers Büro, the parser mistakenly assumes them to be wrint, flaschen shownotes.
The bug particularly appeared with wrint-305.

Bug reported by @mrm0e

wrintwrint

Line 550: archive_path+="wrint";

adds another "wrint" to $archive_path, which already contains wrint, resulting in "wrintwrint"

Q&D fix: comment out line 550

Bluemoon Nummerierung

Den Archivnamen, und den Sendungstitel beim Blue Moon richtig vorhersagen/annehmen.

Konkret: einfach noch mal Variablen neu schreiben mit:

    actualNamesFromMask "${episode_number}";
    archive_filename="${poddata["fname_proper"]}";
    sendungstitel="${poddata["title_proper"]}";

in
https://github.com/Quimoniz/hec/blob/master/hec.sh#l535

oder den Code so umschreiben, dass archive_filename und sendungstitel zum Schluss hin noch ein mal neu generiert werden (auf Basis der Masken der config-file).

Danke an @vale für das Melden des Bugs!

parsing of wrint-198 doesn't work online

When invoking

bash hec.sh wrint-198

the result is an empty output.
However, if the same text is downloaded and parsed with

bash hec.sh file:///home/quimoniz/Downloads/wrint-198

the shownotes are parsed correctly.

Since that error occurs, while the ShowPad is online, it appears there is an unknown bug causing this problem.
_Suggested approach to solving this problem_
Taking part of the shownotes and parsing them if they produce a result. If they parse, add some more, until it does not parse again (thus indicating which additional part produces the error). If the first test fails, reduce the size of the sample part, until it works. Then gradually add, until the error reoccurs, thus finding out which addition, which string caused the error

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.