view · edit · sidebar · attach · print · history

< Niklaus.20161116-davaz-rack | Index | Niklaus.20161114-steinwies-rack >>

20161115-davaz-rack

Summary

  • Fix lppv prices in oddb.org
  • Convert davaz.com to use SBSM 1.3.1 with rack
  • Update steinwies.ch to use SBSM 1.3.2 and fix apache logging
  • Keep in Mind

Commits

Index

Convert davaz.com to use SBSM 1.3.1 with rack

The following tests failed:

  • When loading http://davaz.ngiger.ch/ the introduction (pencil drawing animation is skipped)
  • http://davaz.ngiger.ch/en/works/multiples/ show the content of pannellum.js and does not display the animation
    • HTTP-Fox shows that the file panellum.html is given back as text/plain instead of text/html
    • Also all *.png, *.gif, and the like are returned as text/plain instead of image/png, image/gif.

I think the call method in sbsm/app.rb should try to guess the MIME-type of the requested file and return it. Looking for a ruby gem to handle this task. Looks like https://github.com/minad/mimemagic could to the job well. Adding the code was simple.

Just discovered that the files under /var/www/steinwies.ch/log/2016/11/15 belong to root, which is a problem if you want to restart the steinwies jobs, which run as apache.

On oddb-ci2 changed the in the steinwies Apache configuration the ErrorLog and CustomLog to include sudo -u apache. Line looks now like ErrorLog "|sudo -u apache /usr/sbin/cronolog -l /var/www/steinwies.ch/log/error_log /var/www/steinwies.ch/log/%Y/%m/%d/error_log" After a restart of the services, changing manually the owner of the log directory and restarting apache2, all log files have now apache as owner.

Pushed commit Require drb_uri parameter on init. Handle Mimetype

Steinwies.ch and davaz.com need now a small change for the App.new as the drb_uri-parameter is required.

Pushed first the following commits for sbsm: Fix unit test. Still skip test_post_feedback and Bumped version to 1.3.2

The problem about the first sketch drawing is still open. Also we have

Fix lppv prices in oddb.org

We got the following error message

Plugin: ODDB::LppvPlugin
Error: NoMethodError
Message: undefined method `each_row' for nil:NilClass
Backtrace:
/var/www/oddb.org/src/plugin/lppv.rb:30:in `eans'
/var/www/oddb.org/src/plugin/lppv.rb:71:in `get_eans'
/var/www/oddb.org/src/plugin/lppv.rb:58:in `block (2 levels) in update'
/var/www/oddb.org/src/plugin/lppv.rb:57:in `upto'
/var/www/oddb.org/src/plugin/lppv.rb:57:in `each'
/var/www/oddb.org/src/plugin/lppv.rb:57:in `block in update'
/usr/local/lib/ruby/1.9.1/net/http.rb:745:in `start'
/var/www/oddb.org/src/plugin/lppv.rb:56:in `update'
/var/www/oddb.org/src/util/updater.rb:525:in `update_immediate'
/var/www/oddb.org/src/util/updater.rb:377:in `update_lppv'
/var/www/oddb.org/src/util/updater.rb:426:in `update_swissmedic_followers'
/var/www/oddb.org/src/util/updater.rb:205:in `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `call'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>'

Running jobs/import_bsv_followers to try to reproduce the problem on oddb-ci2. Done.

The current algorithm tries to fetch the products by calling the address http://www.lppa.ch/index/A.hml but http://www.lppv.ch/produkteuebersicht/suchen-nach-artikeln/. lppa.ch is now redirected to lppv.ch and http://www.lppv.ch/index/A.htm now returns

Nichts gefunden, Entschuldige bitte, aber die Seite konnte nicht gefunden werden. Vielleicht hilft die Suchfunktion ein Ergebnis zu finden.

On the same page we find a download link http://www.lppv.ch/20160530/wp-content/download/LPPV_D.xlsx. There we find 691 products with the following content

PhCode	GTIN	Artikelname	IT	Bezeichnung	muteDate	muteTyp
3075085	7680452090328	ACETOCAUSTIN liq Fl 1 ml	10.07.00	KERATOLYTICA	30.09.2016	1

There is a similar download for the french version. http://www.lppv.ch/20160530/wp-content/download/LPPA_F.xlsx.

It was easy to download and parse the package. Reworkin the unit test to use vcr and mocking it with just 2 packages. Why did the unit tests have checks for prices going up and down when we have no prices in the downloaded XLSX file?

Test about the PriceUpdate where removed by Yasuhiro in May 2012, but without updating the test. Removing them completely.

Changed the mailing subject to "LPPV" omitting obsolete prices. Asking Zeno whether we should include in the reports the GTINs of updated items and pharmacode/name of LPPV items without a GTIN.

Modified the code accordingly, dropped and reloaded the database to see the LPPV changes. Received e-mail with

Updated Packages (lppv flag true): 27 details:
7680613370030 pharma  Levomin 30, Filmtabletten
7680262930012 pharma 6199209 1001 Blattgrün Dragées
7680179810018 pharma 6199190 1001 Blattgrün Tabletten
7680554570209 pharma 2077610 Elixir frangulae compositum Streuli, Elixir
7680547490019 pharma 6593248 Supradyn Vital 50+, Filmtabletten
7680547490026 pharma 6593260 Supradyn Vital 50+, Filmtablette
<..>

Looks good. Pushing commit Download xlsx file for updating LPPV

Update steinwies.ch to use SBSM 1.3.2 and fix apache logging

Pushed commit Updated to sbsm 1.3.2 (drb_uri)

Update apache config to include sudo -u apache before the chronolog. Pulled the changes to fastpower, called bundle install, restarted services and apache2. Everything looks okay now.

view · edit · sidebar · attach · print · history
Page last modified on November 15, 2016, at 05:52 PM