Should calculate OpenURI href in src/view/tooltip.rb
by a locally instead of fetching it via OpenURI.
Looking at http://oddb-ci2.dyndns.org/de/gcc/show/reg/43788/seq/01/pack/035 which takes a long time to load because the facebook like button cannot be loaded.
In https://github.com/ngiger/oddb.org/blob/master/src/view/facebook.rb#L23 we see it marked as TODO.
But some queries, eg. http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/Novartis/search_type/st_company? (The /var/www/oddb.org.rack/log/2017/07/10/user_log shows 4.5083 seconds) now run a lot faster than on oddb-ci2.
The facebook like button works for Migel results, because https://github.com/ngiger/oddb.org/blob/master/src/view/migel/result.rb#L195 contains the call to facebook_sdk + html. But this cannot be found in any other place.
The View::Facebook is included in the following files
src/view/migel/result.rb: include View::Facebook src/view/drugs/centeredsearchform.rb: include View::Facebook src/view/drugs/package.rb: include View::Facebook src/view/drugs/ddd_price.rb: include View::Facebook
But which views of ch.oddb.org should really display a facebook like symbol?
It is more complicated to add a facebook_share than I thought at the beginnen. The migel was a hack that worked only for the migel result. But we must add it like the twitter_share in the src/view/additional_information.rb.
Now http://oddb-ci2.dyndns.org/de/gcc/show/reg/43788/seq/01/pack/035 and http://oddb-ci2.dyndns.org/de/gcc/search/zone/drugs/search_query/Revolade/search_type/st_sequence?#best_result display the facebook links. But in the http://oddb-ci2.dyndns.org/de/gcc/show/reg/43788/seq/01/pack/035 it is displayed above the twitter and not beside.
As I had to set the lookandfeeld to a a default value, I must disable it all the LNFs, where it should not be displayed.
Zeno ran tests and we discovered that the facebook buttons take too much time. Therefore we decided:
The current diff is Attach:facebook_button_work_but_is_slow.diff.txt
Pushed commit Fixed displaying facebook like. Now I must fix the unit tests, too. Pushed commit Fix unit tests after removing facebook errors
Running smoketest. Had two errors ch.oddb.org should have a link to the english language version
and ch.oddb.org should have a working instant search for Augmentin and going back
. Skip the known problem with augmentin which contains a ( in the backtrace link). Ran the smoketest again and pushed commit Fix smoketest english.
Installed the new version on thinpower. Looked in /var/www/oddb.org.rack/log/2017/07/10/user_log
for bot entries and found lines like
144.76.30.241 - - [10/Jul/2017 16:22:49] "GET http://xn--homopathika-tfb.ch/fr/homeopathy/search/zone/drugs/search_query/Metaneuron+N/search_type/st_oddb/currency/EUR HTTP/1.1" 200 310442 0.6241 "Mozilla/5.0 (compatible; MJ12bot/v1.4.7; http://mj12bot.com/)"
The http.conf defines xn--homopathika-tfb.ch to use the DocumentRoot /var/www/oddb.org.rack/doc where the robots.txt does NOT contain a line like
Disallow: Disallow: /fr/homeopathy
Adding a new rack process for generika on thinpower.
Checking whether the apache.conf works fine for the log using
curl -v --user-agent 'Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)' http://xn--homopathika-tfb.ch/fr/homeopathy/search/zone/drugs/search_query/Metaneuron+N/search_type/st_oddb/currency/EUR
And grepping on thinpower like this grep 'search_query/Metaneuron+N/search_type/st_oddb/currency/EUR' /var/www/oddb.org.rack/log/2017/07/10/*_log
to find the entry
/var/www/oddb.org.rack/log/2017/07/10/user_log:80.218.53.88 - - [10/Jul/2017 17:18:09] "GET http://xn--homopathika-tfb.ch/fr/homeopathy/search/zone/drugs/search_query/Metaneuron+N/search_type/st_oddb/currency/EUR HTTP/1.1" 200 310442 0.7736 "Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)"
Which is wrong as it should have been redirected to the /var/www/oddb.org.rack/log/2017/07/10/crawler.log
. Will fix this tomorrow. Accessing http://generika.cc/ produces log entries in /var/www/oddb.org.rack/log/2017/07/10/generika.log
. But the lookandfeel is not respected. Fixed this problem. Current apache.conf is Attach:20_oddb.org.conf.rack.2017.07.10.txt