function explodeCatz($filename) { $dir = dirname($filename); $f = file($filename); while (list($index, $line) = each($f)) { $line = trim($line); if (empty($line)) { continue; } if (sex($line)) { $sex[] = $line; unset($f[$index]); continue; } if (mixed_adult($line)) { $mixed[] = $line; unset($f[$index]); continue; } if (gamble($line)) { $gamble[] = $line; unset($f[$index]); continue; } if (games($line)) { $games[] = $line; unset($f[$index]); continue; } if (radio($line)) { $radio[] = $line; unset($f[$index]); continue; } if (music($line)) { $music[] = $line; unset($f[$index]); continue; } if (webtv($line)) { $webtv[] = $line; unset($f[$index]); continue; } if (movies($line)) { $movies[] = $line; unset($f[$index]); continue; } } @file_put_contents($filename, @implode($f)); @file_put_contents("{$dir}/" . time() . ".music.txt", @implode("\n", $music)); @file_put_contents("{$dir}/" . time() . ".radio.txt", @implode("\n", $radio)); @file_put_contents("{$dir}/" . time() . ".sex.txt", @implode("\n", $sex)); @file_put_contents("{$dir}/" . time() . ".movies.txt", @implode("\n", $movies)); @file_put_contents("{$dir}/" . time() . ".games.txt", @implode("\n", $games)); @file_put_contents("{$dir}/" . time() . ".webtv.txt", @implode("\n", $webtv)); @file_put_contents("{$dir}/" . time() . ".gamble.txt", @implode("\n", $gamble)); @file_put_contents("{$dir}/" . time() . ".mixed_adult.txt", @implode("\n", $mixed)); }
<?php $movies = movies($from); print_sms_reply($movies); function movies($location) { require_once 'simple_html_dom.php'; $str = get_query('http://www.google.com/movies?near=' . urlencode($location)); $html = str_get_html($str); $lines = array(); foreach ($html->find('#movie_results .theater') as $div) { $i = 0; foreach ($div->find('.movie') as $movie) { $times = remEntities(strip_tags($movie->find('.times', 0)->innertext)); $line = strip_tags($movie->find('.name a', 0)->innertext) . ' [ ' . $times . ' ] @ ' . strip_tags($div->find('h2 a', 0)->innertext); $lines[$line] = $line; $i++; if ($i == 10) { break; } } break; } $html->clear(); return $lines; }
forms(); break; case 'fundraising': include '../view/fundraising.php'; break; case 'home': home(); break; case 'movieDisp': movieDisp(); break; case 'movieList': movieList(); break; case 'movies': movies(); break; case 'movieSchedule': movieSchedule(); break; case 'movieFullSchedule': movieFullSchedule(); break; case 'movieWeeklySchedule': movieWeeklySchedule(); break; case 'news': newsHome(); break; case 'newsDisp': newsDisp();