BlackBerry Device OS Checker

done.
\n"; flush(); echo "Parsing carrier list for links... "; flush(); $link_array = array(); $cnt_array = explode("\n", $carriers); foreach ($cnt_array as $line) { if (stristr($line, "www.blackberry.com")) { // http://www.the-art-of-web.com/php/parse-links/ $regexp = "]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; if (preg_match_all("/$regexp/siU", $line, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { # $match[2] = link address # $match[3] = link text $link_array[$match[2]] = $match[3]; } } } } echo "done.

\n"; flush(); echo "Searching for OS releases for the BlackBerry $device

\n"; flush(); reset($link_array); while (list($link, $title) = each($link_array)) { echo "Checking $title...
\n"; flush(); $rim_page = getPage($link); $rim_array = explode("\n", $rim_page); $got_v = 0; $got_c = 0; $value = ""; $code = ""; foreach ($rim_array as $line) { // get the value if (stristr($line, $device)) { $regexp = "(.*)<\/option>"; if (preg_match("/$regexp/siU", $line, $match)) { $got_v = 1; $value = $match[1]; } } // get the code if (stristr($line, "type=\"hidden\" name=\"code\"")) { $regexp = "value=\"([^\"]*)\"(.*)"; if (preg_match("/$regexp/siU", $line, $match)) { $got_c = 1; $code = $match[1]; } } } if ($got_v && $got_c) { echo "  Found one, retrieving product page...
\n"; flush(); $postvars = "productName=$value&code=$code"; $os_page = getPage($RIM_DLURL, "POST", $postvars); $os_array = explode("\n", $os_page); foreach ($os_array as $osline) { if (stristr($osline, "Applications:")) { $result = preg_replace("/<(.*)>/siU", "", $osline); echo "    $result
\n"; } } } sleep($RIM_SLEEP); } echo "
All done!
\n"; } else { ?> Enter the model number ONLY of the device.
(7290, 8100, 8320, 8800, etc.)

Note: This tool will only search carriers who
host their downloads on www.blackberry.com

Code: bboschecker on github
Released under the GPLv2 license