FREEBASIC 109
Code for Grabing US COVID19 Data US By pagetelegram on 29th July 2021 12:50:11 AM
  1. dim ter$(6)
  2. print "Grabing US data"
  3. shell "wget https://raw.githubusercontent.com/nytimes/covid-19-data/master/us.csv"
  4. ter$(0)="us.csv"
  5.  
  6. shell "rm *.txt"
  7. for i=0 to 0
  8.   shell "echo "+mid$(ter$(i),1,len(ter$(i))-4)+" - "+date$+" - "+time$+" >> "+mid$(ter$(i),1,len(ter$(i))-4)+".txt"
  9.   shell "tail "+ter$(i)+" > height.csv"
  10.    open "height.csv" for input as #2
  11.     do
  12.      hitter$=hit1$
  13.       if not (eof(2)) then input #2, hit1$,hit2$,hit3$,hit4$,hit5$,hit6$
  14. ck=ca
  15.       if hitter$=hit1$ then
  16.           ca=ca+val(hit5$)              
  17.          else
  18.           cf=ca
  19.  
  20.           ca=0
  21.         end if
  22.     x = cf                                                 ' X = Maxium
  23.     loop until eof (2)
  24.    close #2
  25.     if cf<>0 then fac=180                                   ' FAC = Ceiling 80
  26.  open ter$(i) for input as #1
  27. ut=0
  28.  do      
  29.   dater$=date1$
  30.  
  31.   if not (eof (1)) then input #1,date1$,county2$,state3$,del4$,cases5$,deaths6$
  32.  
  33.    cases5$=county2$   ' modifier for fields 2,3 of us.csv
  34.    deaths6$=state3$   ' modifer for fields 2,3 of us.csv
  35.   xx=xx+val(cases5$)
  36.   xt=xx                                                                                                   ' XT = Current State Value
  37.   if dater$<>date1$ then xx=0
  38.     if xt<>0 then ct=fac*(x/xt)
  39.     for graph=1 to xt/1000  
  40.       grph$=grph$+"X"
  41.     next graph
  42.   if dater$<>date1$ then shell "echo "+date1$+"-"+grph$+" >> "+mid$(ter$(i),1,len(ter$(i))-4)+".txt"
  43.  grph$=""
  44.  loop until eof(1)
  45. close #1
  46. next i

Bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

This bin is created for anyone to paste text related to anything of public interest or letters to public officials. Anything else posted that is not a public interest matter may be deleted. If you would like such letter to be faxed to Congress, please refer to services offered at pagetelegram.com
Raw Paste

Login or Register to edit or fork this paste. It's free.

.guestmsg{display:none!important;}