package Ġde . mar cre iche lt . vir us infos Ċ Ċ import Ġokhttp 3 . ResponseBody Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . http . GET Ċ Ċ interface ĠV acc ination Api Ġ{ ĊĊĠĠĠ Ġ// Ġhttps :// imp fd ashboard . de / static / data / ger many _ v acc inations _ timeseries _ v 2 . tsv ĊĠĠĠ Ġ@ GET (" static / data / ger many _ v acc inations _ timeseries _ v 2 . tsv ") ĊĠĠĠ Ġsuspend Ġfun Ġv acc inations T sv (): ĠResponse Body Ċ Ċ } Ċ Ċ suspend Ġfun Ġdownload V acc ination Data (): ĠV acc ination Data Ġ{ ĊĠĠĠ Ġval Ġretrofit Ġ= ĠRet rofit . Builder (). baseUrl (" https :// imp fd ashboard . de "). build () ĊĠĠĠ Ġval Ġapi Ġ= Ġretrofit . create ( V acc ination Api :: class . java ) ĊĠĠĠ Ġval Ġt sv Ġ= Ġapi . v acc inations T sv () ĊĠĠĠ Ġreturn Ġparse V acc inations ( tsv . char Stream (). read Lines ()) Ċ } Ċ Ċ fun Ġparse V acc inations ( tsv Lines : ĠList < String >): ĠV acc ination Data Ġ{ ĊĠĠĠ Ġval Ġheaders Ġ= Ġt sv Lines . first (). split ('\ t ') ĊĠĠĠ Ġval Ġnewest Data Ġ= Ġt sv Lines . last (). split ('\ t ') ĊĠĠĠ Ġval Ġfirst V acc ination Index Ġ= Ġheaders . indexOf (" imp f _ quote _ er st ") ĊĠĠĠ Ġval Ġfull V acc ination Index Ġ= Ġheaders . indexOf (" imp f _ quote _ vol l ") ĊĠĠĠ Ġrequire ( first V acc ination Index Ġ!= Ġ- 1 Ġ&& Ġfull V acc ination Index Ġ!= Ġ- 1 ) ĊĊĠĠĠ Ġval Ġfirst V acc ination Ġ= ĠPercent ( new est Data [ first V acc ination Index ]. toFloat ()) ĊĠĠĠ Ġval Ġfull V acc ination Ġ= ĠPercent ( new est Data [ full V acc ination Index ]. toFloat ()) ĊĊĠĠĠ Ġreturn ĠV acc ination Data ( first V acc ination , Ġfull V acc ination ) Ċ } Ċ Ċ data Ġclass ĠV acc ination Data ( val Ġfirst V acc ination : ĠPercent , Ġval Ġfull V acc ination : ĠPercent ) Ċ