Question: Using data pulled from box office mojo, add on to the following c code to display the studio and the number of theaters the movie
Using data pulled from box office mojo, add on to the following c code to display the studio and the number of theaters the movie is playing in.
#include
#define MAX_MOVIES 30
struct movie_type { char name[128]; char gross[128]; };
char *ptr, buffer[16392], cmd[512]; char company_name[128], zipcode[64]; char wind_speed[64], wind_direction[64]; char us_state[32], us_city[128], tod[64]; int i, n, first_time, indx, state; struct movie_type movies[MAX_MOVIES];
int main(int argc, char *argv[]) { FILE *fp;
sprintf(cmd, "wget -qO- http://www.boxofficemojo.com/weekend/chart/");
if((fp = popen(cmd, "r")) != NULL) { state = 0;
while (!feof(fp)) { if (fgets(buffer, sizeof(buffer) - 1, fp) != NULL) { switch (state) { case 0: if (strstr(buffer, "
