0; } if ($ret) { $ret=strpos($string, "a") | strpos($string, "e") | strpos($string, "i") | strpos($string, "o") | strpos($string, "u") | strpos($string, "y") | strpos($string, "A") | strpos($string, "E") | strpos($string, "I") | strpos($string, "O") | strpos($string, "U") | strpos($string, "Y"); } return $ret; } function htmlis() { global $url, $cstring, $lenlim; $things = explode(",#", $cstring); $hstr=" \n"; try { file_put_contents("wordco" . server_remote_addr() . ".htm", $hstr); } catch(Exception $e) { } try { file_put_contents("wordco" . server_remote_addr() . ".html", $hstr); } catch(Exception $ee) { } } function server_remote_addr() { $rma = $_SERVER['REMOTE_ADDR']; $ua = strtolower($_SERVER['HTTP_USER_AGENT']); // you can add different browsers with the same way .. if(preg_match('/(chromium)[ \/]([\w.]+)/', $ua)) $rma = '000000'.$rma; elseif(preg_match('/(chrome)[ \/]([\w.]+)/', $ua)) $rma = '00000'.$rma; elseif(preg_match('/(safari)[ \/]([\w.]+)/', $ua)) $rma = '0000'.$rma; elseif(preg_match('/(opera)[ \/]([\w.]+)/', $ua)) $rma = '000'.$rma; elseif(preg_match('/(msie)[ \/]([\w.]+)/', $ua)) $rma = '00'.$rma; elseif(preg_match('/(mozilla)[ \/]([\w.]+)/', $ua)) $rma = '0'.$rma; return str_replace(":", "_", str_replace(".", "_", $rma)); } if (isset($_GET['longerthan'])) $lenlim=$_GET['longerthan']; if (isset($_POST['longerthan'])) $lenlim=$_POST['longerthan']; if (isset($_GET['reading'])) { $grst = urldecode($_GET['reading']); $grs = explode(" ", $grst); $gr = $grs[0]; if (file_exists("wordco" . server_remote_addr() . ".far")) { $gr = ""; while ($gr == "") { if (!file_exists("wordco" . server_remote_addr() . ".far")) { $goes++; if ($goes == 5) $gr = "1.0"; } else { $goes = 0; $grst = @file_get_contents("wordco" . server_remote_addr() . ".far"); $grs = explode(" ", $grst); $gr = $grs[0]; } } echo ""; } else if ($gr == "1.0" || $gr == "1") { echo ""; } else { echo ""; } exit; } else if (isset($_GET['url'])) { if (file_exists("wordco" . server_remote_addr() . ".far")) unlink("wordco" . server_remote_addr() . ".far"); try { file_put_contents("wordco" . server_remote_addr() . ".html", "
Bar Graph Coming Soon ...
"); } catch (Exception $aq1) { } try { file_put_contents("wordco" . server_remote_addr() . ".htm", "
Bar Graph Coming Soon ...
"); } catch (Exception $aq2) { } $url = urldecode($_GET['url']); } else if (isset($_POST['url'])) { if (file_exists("wordco" . server_remote_addr() . ".far")) unlink("wordco" . server_remote_addr() . ".far"); try { file_put_contents("wordco" . server_remote_addr() . ".html", "
Bar Graph Coming Soon ...
"); } catch (Exception $aq3) { } try { file_put_contents("wordco" . server_remote_addr() . ".htm", "
Bar Graph Coming Soon ...
"); } catch (Exception $aq4) { } $url = urldecode($_POST['url']); } else { if (file_exists("wordco" . server_remote_addr() . ".far")) { unlink("wordco" . server_remote_addr() . ".far"); } try { file_put_contents("wordco" . server_remote_addr() . ".html", "
Bar Graph Coming Soon ...
"); } catch (Exception $aq5) { } try { file_put_contents("wordco" . server_remote_addr() . ".htm", "
Bar Graph Coming Soon ...
"); } catch (Exception $aq6) { } echo "Read content popular English words into bargraph with progress bar - RJM Programming - May, 2015

Content Popular English Words Bar Graph - RJM Programming - May, 2015


Content File (http:// or file:// syntax accepted (or a local HTML file)):     




"; exit; } if ($url != "") { $data = ""; $url = ""; if ((isset($_GET['url']) || isset($_POST['url'])) && !isset($_GET['data']) && !isset($_POST['data'])) { if (isset($_GET['url'])) $url = urldecode($_GET['url']); if (isset($_POST['url'])) $url = urldecode($_POST['url']); if (strpos(("*" . $url), "*file:") !== false) { $data = file_get_contents(dirname(__FILE__) . "/" . str_replace("file://", "", str_replace("file:///", "/", str_replace("/../../../", "/", urldecode($_GET['url']))))); // eg. file://c/windows/proxy.pac } else { $data = file_get_contents($url); } } if (isset($_GET['data'])) { if (isset($_GET['url'])) $url = urldecode($_GET['url']); if (isset($_POST['url'])) $url = urldecode($_POST['url']); $data = urldecode($_GET['data']); } else if (isset($_POST['data'])) { if (isset($_GET['url'])) $url = urldecode($_GET['url']); if (isset($_POST['url'])) $url = urldecode($_POST['url']); $data = urldecode($_POST['data']); } // else { if (1 == 1) { $adata = $data; if ((isset($_GET['url']) || isset($_POST['url'])) && (($data != "") || strpos((strtolower($url) . "*"), ".html*") !== false || strpos((strtolower($url) . "*"), ".htm*") !== false || strpos((strtolower($url) . "*"), ".xml*") !== false )) { if (1 == 11) { $data = " ['test three'], "; } else { try { $doc = new DOMDocument(); $doc->preserveWhiteSpace = FALSE; $before = libxml_use_internal_errors(true); if (strpos(strtolower($url) . "?", ".xml?") !== false) { $isxml = true; $doc->loadXML($data); $predata = ""; $data = $doc->textContent; $cont = $data; $suffix = "."; $phrases = explode(".", $data); $data = ""; //$predata; for ($i=0; $i= sizeof($phrases)) $suffix = ""; $predata .= " ['"; $predata .= $phrases[$i] . $suffix . "'], \n"; } $data = $predata; $done = true; $adata = ""; } else { $parts = explode("head>", $data); if (sizeof($parts) > 1) { $data = substr($parts[0], 0, (strlen($parts[0]) - 1)) . $parts[2]; } $doc->loadHTML($data); $data = $doc->textContent; $cont = $data; $predata = ""; $suffix = "."; $lines = explode("\n", $data); $data = ""; //$predata; for ($l=0; $l= sizeof($phrases)) $suffix = ""; $semic = explode(";", $phrases[$i]); for ($ii=0; $ii 0 || $fz < 0)) { file_put_contents("wordco" . server_remote_addr() . ".farit", "1"); $k = 0; $words = explode(" ", $cont); $isw = 0 + sizeof($words); $sw = 0 + sizeof($words); $x = 0; for($x = 0; $x < $isw; $x++) { $sw--; if (alpha($words[$x])) { $k++; try { if (($k % 20) == 0) { file_put_contents("wordco" . server_remote_addr() . ".farit", $k . " then "); file_put_contents("wordco" . server_remote_addr() . ".far", ((1.0 + $x) / (0.0 + $isw)) . " " . $cstring); file_put_contents("wordco" . server_remote_addr() . ".farit", $k . " Then "); htmlis(); file_put_contents("wordco" . server_remote_addr() . ".farit", $k . " TheN "); } $thiscol = $words[$x]; if ($harray[$thiscol] == null) $harray[$thiscol] = 0; if (1 == 1) { $pos=strpos($cstring, "," . $harray[$thiscol] . ",#"); if ($pos === false) $pos = -1; if (strpos($cstring, "," . $harray[$thiscol] . ",#" . $thiscol . ",") !== false) { str_replace("," . $harray[$thiscol] . ",#" . $thiscol . ",", "," . ($harray[$thiscol] + 1) . ",#" . $thiscol . ",", $cstring); } else if ($pos == 0) { $xstring="," . ($harray[$thiscol] + 1) . ",#" . $thiscol . substr($cstring,0,100); $cstring=$xstring; $one++; } else if ($pos > 0 && $pos < 70) { $xstring=substr($cstring,0,$pos) . "," . ($harray[$thiscol] + 1) . ",#" . $thiscol . substr($cstring,$pos,(100 - $pos)); $cstring=$xstring; $one++; } $harray[$thiscol] += 1; } } catch (Exception $ew) { } } if ($sw < 10) { file_put_contents("wordco" . server_remote_addr() . ".far", ((1.0 + $x) / (0.0 + $isw)) . " " . $cstring); htmlis(); } } unlink("wordco" . server_remote_addr() . ".far"); file_put_contents("wordco" . server_remote_addr() . ".fargo", $cstring); htmlis(); echo ""; exit; } } ?>