Question: UNIX C Code: I need to edit the code so with the output it also outputs the studio of the movie and the number of
UNIX C Code: I need to edit the code so with the output it also outputs the studio of the movie and the number of theaters the movies were playing in. below is my current code, thank you for the help!
#include
struct movie_type{ char name[128]; char gross[128]; char studio[128]; char numTheaters[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, "
