File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 41
41
} else {
42
42
$ donor_object = json_decode ($ local_donor , true );
43
43
}
44
+ } else {
45
+ // Request for data
46
+ $ donor_data = @file_get_contents ("https://api.foldingathome.org/user/ " .$ donor , false , stream_context_create ($ arr_context_options )) or die ("api failed " );
47
+ $ donor_object = json_decode ($ donor_data , true );
48
+ if (array_key_exists ("status " , $ donor_object )) {
49
+ exit ("api failed " );
50
+ }
51
+ if ($ DEBUG ) var_dump ($ donor_object );
44
52
}
45
53
if (file_exists ("teams/ " .$ team )) {
46
54
$ local_team = file_get_contents ("teams/ " .$ team );
55
63
} else {
56
64
$ team_object = json_decode ($ local_donor , true );
57
65
}
66
+ } else {
67
+ // Request for data
68
+ $ team_data = @file_get_contents ("https://api.foldingathome.org/team/ " .$ team , false , stream_context_create ($ arr_context_options )) or die ("api failed " );
69
+ $ team_object = json_decode ($ team_data , true );
70
+ if (array_key_exists ("status " , $ team_object )) {
71
+ exit ("api failed " );
72
+ }
73
+ if ($ DEBUG ) var_dump ($ team_object );
58
74
}
59
75
60
76
// Save record
You can’t perform that action at this time.
0 commit comments