view · edit · sidebar · attach · print · history

< Niklaus.20170404-poloniex | Index | Niklaus.20170329-davaz-upload-image >>

20170403-oddb-dosing

Summary

  • Fix dosing links for Niereninssuffizienz in oddb.org
  • Fix update drugbank links
  • Rapflag support for Poloniex
  • Keep in Mind

Commits

Index

Fix dosing links for Niereninssuffizienz in oddb.org

Iterate over the 823 links instead of the 7872 atc_classes. Also we have several ambiguities, eg. for Natriumflorid. Reworking the loop to iterate over the links needs a way to treat fix all atc_classes which have no links. Done. Running the jobs/update_atc_dosing_link while starting next task.

Had an error in the report function. Corrected. The generated links are okay now. Rerunning import again. Pushed commit Fix atc dosing links. Reworked loop

Update job finished on thinpower. Tested that using Nolvadex ch.oddb.org has a working "Dosisanpassung bei Niereninssuffizienz"

Fix update drugbank links

Must show, why the links are no longer corectly updated. Asking Zeno whether it would not be a better idea just to check, whether there is a drugbank entry for a given ATC code or not. Yes, Zeno thinks this is a good idea, too. Adapting code and unit test to the new expectations. Did not find a way on howto mock a Mechanize::ResponseError in the unit tests. Running update job locally. No this does not work.

There is a possibilit to use an API (which however is not cost less).

Using HTTP-Fox I see the following requests

GET	https://www.drugbank.ca/unearth/advanced/drugs/field?name=atc_code # which returns some cookies
__cfduid	d144e0ccde68c6591d9d2a628954e082f1491205943	/	.drugbank.ca	3.4.2018, 09:52:23
_omx_drug_bank_session	US9ycEJIWnNVd0dwQUZvbUM4U2RNNVUzSFNEaW55b0d0MjAzRytCamU0SSs5TmdGbFl4RzRVUHZaaVhUZXlxbmtheXJFcU1GL0VPVTNLLzFYQVNFaVN3aWhsaTBwN1hmdm0rclVjcVlmVGtkUmt6cWE1TnA3Vk5qK25ZdlNZM1hmNjhXRW11MVZtak9xYlRySGtLMWhRPT0tLUFxNldERjlERGlUWmg4bFVzb0ExSnc9PQ%3D%3D--9c61869c55ed32289d4d729ccff9dda568605880	/	www.drugbank.ca	End Of Session
_ga	GA1.2.1158785963.1491205964	/	.drugbank.ca	3.4.2019, 15:18:34
_hjIncludedInSample	1	/	www.drugbank.ca	End Of Session
# followed by
POST	https://www.drugbank.ca/unearth/advanced/drugs # with the following post data
utf8	&#156;&#147;
authenticity_token	MPu7D6eFiuuPNK4SwJKZbHwjALx26uGvP1OzvF5EDQMgaukqdbCFCyOcIgffRAif4zI4nVAV+N0f1QqEsL8WBw==
commit	true
query_type	all
fields[1491225575][field]	atc_code
fields[1491225575][predicate]	cont
fields[1491225575][value]	L02BA01
button

But here I got many results for ATC-Code L02BA01. But the search https://www.drugbank.ca/unearth/q?utf8=%E2%9C%93&query=Tamoxifen&searcher=drugs&approved=1&vet_approved=1&nutraceutical=1&illicit=1&withdrawn=1&investigational=1&button= provided exactly one result.

Looks like my new search algorithm finds much more entries in drugbank. Waiting for import to finish. Check that also name with spaces, like "Bisoxatin, Kombinationen", ATC-code A06AB59 references now the correct db_id. update reported

Checked ATC classes   : 6325
Actived Drugbank Link : 4399
Non-link ATC classes  : 1926
Update job took       : 4407 seconds

Pushed commit Fix updating drugbank links via name

Rapflag support for Poloniex

Pushed first another requestested change Output files start with currency name. To support the Poloniex API in parallel (or alternatively) to the Bitfinex API, I must refactor the History class -> Bitfinex, an ensure that afterwards the Summary can work with objects from both APIs. Done for Bitfinex with Refactored History -> History and Bitfinex

It is not so simpel to return the desired info from ght poloniex API. Also the ruby gem does not provide access to all information, e.g. returnAvailableAccountBalances, returnDepositsWithdrawals, returnDepositAddresses, returnCompleteBalances. Also I have the following error

::Poloniex.balances
RestClient::UnprocessableEntity: 422 Unprocessable Entity
from /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response'

Does the Ruby gem pass the secret correctly to the post request? Debugging my forked poloniex. Fixed reading the configuration.

Now I have many errors 403 Forbidden like

[8] pry(#<RAPFLAG::Poloniex>)> x = ::Poloniex.deposit_addresses
RestClient::Forbidden: 403 Forbidden
from /home/niklaus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response'
view · edit · sidebar · attach · print · history
Page last modified on April 04, 2017, at 08:34 AM