示例#1
0
        echo "<br>tweeted";
        $total_return = "Thank you for using Tweet a card service. Your card has been sent to {$gcmsg}.\nImage: {$gclink} ";
        //        $total_return .= "Browsing charges(10p/10kB) apply.";
        //        $total_return .= "\n--\nDial *321*552# (Tollfree) to send customized cards to your loved ones!";
        //$total_return = $total_return . "\n--\nTo send your Friend a customised greeting card, Sms GC <your name> TO <friends name> to $shortcode @ Rs. 3.";
        $service_name = 'tc';
        $product_name_tag = 'Tweet a Card';
        $to_logserver['source'] = 'tc';
        putOutput($total_return);
        exit;
    }
} elseif (preg_match("~^(bp)\\b~", $req)) {
    if ($number != '7709087556') {
        echo "<br>TWEET CARD WITH NAME<br>";
        $u_name = preg_replace("~^(bp)\\b~", '', $req);
        $u_name = remwords($u_name);
        $u_name = SafeSearch($u_name);
        $u_name = trim(preg_replace("~[\\s]+~", " ", $u_name));
        $w_count = str_word_count($u_name);
        if ($w_count > 0 && $w_count < 4 && strlen($u_name) < 20) {
            $gcfrom = (string) ucfirst($u_name);
            $gcto = 'Dear Bipasha';
            $gcmsg = 'Bipasha Basu';
            echo "<br>From:";
            var_dump($gcfrom);
            echo "<br>To:";
            var_dump($gcto);
            echo "<br>Inside TC result";
            $uniq_id = uniqid();
            mysql_close();
            include 'lib/configdb_up.php';
示例#2
0
    $total_return = $image_url;
    if ($operator == 'airtel') {
        $total_return .= "\n{$brows_charge}";
    }
    echo '<br>' . $total_return;
    $to_logserver['source'] = 'photo';
    putOutput($total_return);
    exit;
}
if (preg_match("~(http://([\\w\\d]{,4}\\.)?[\\w\\d-]+\\.[\\w]{2,4}(\\.[\\w]{2,4})?)\\b~", $req, $match)) {
    echo "<br>URL FOUND: ";
    echo $requrl = $match[1];
} elseif (preg_match("~(([\\w\\d]{,4}\\.)?[\\w\\d-]+\\.[\\w]{2,4}(\\.[\\w]{2,4})?)\\b~", $req, $match)) {
    echo "<br>URL FOUND: ";
    echo $requrl = "http://{$match['1']}";
}
echo "<h3>City </h3>";
include 'msi_city.php';
if ($spell_checked == 'bhitarkanika mangroves') {
    $options_list[] = "Bhitarkanika National Park";
    $list[] = array("content" => "bhitarkanika national park");
}
//IDENTIFY KEYWORDS<bR>';
$isMsi = false;
$weather_word = trim(remwords($spell_checked));
include 'lyricsOpnList.php';
//include 'linkedin.php';
echo $spell_checked;
echo "<h2>BEFORE WEATHER RESULT : </h2>" . $weather_word;
//Love and Flame Calculator
include 'loveFlame.php';
示例#3
0
ini_set("display_errors", "off");
ob_start();
echo "<pre>";
include 'lib/appconfigdb.php';
include 'class.Resource.php';
include 'functions.php';
include 'lib/data-files.php';
include 'tagging.php';
include 'class.Mediawiki.php';
$infoArr = array();
${$quArr} = array();
//$query = remwords($query);
$machine_id = set_machine_id();
$query = $_GET['q'];
$query = remwords(urldecode($query));
echo "<br>Query: {$query} <br>";
$quArr = explode(' ', trim($query));
echo "<br>After Explode";
var_dump($quArr);
$gid = $_GET['gid'];
$sm = $_GET['sm'];
$direct = isset($_GET['direct']) && ($_GET['direct'] == 'true' || $_GET['direct'] == 1) ? true : false;
$mwiki = new Mediawiki($gid, $sm);
echo $query . '<br>';
print_r($mwiki->get_data($query));
if (isset($_GET['debug'])) {
    echo "</pre>";
    ob_end_flush();
} else {
    ob_end_clean();
示例#4
0
<?php

if (preg_match("~\\b(price|grocery price)\\b(.+)~", $spell_checked, $match) && !preg_match("~\\b(apple i phone|apple 4s|apple iphone|apple 3g|apple 5s|apple ipad|appleipad|apple (.+))\\b~", $spell_checked)) {
    echo $spell_checked;
    echo $query = $match[1];
    if (isset($match[2])) {
        $query = $match[2];
    }
    $query = remwords($query);
    $query = trim($query);
    $url = "http://IP/solr/db/select/?version=2.2&start=0&rows=10&indent=on&q=" . urlencode($query) . "";
    $content = file_get_contents($url);
    $arXml = objectsIntoArray(simplexml_load_string($content));
    if (!empty($arXml["result"]["doc"])) {
        foreach ($arXml["result"]["doc"] as $doc => $arDocs) {
            var_dump($arDocs);
            echo $doc;
            if (is_numeric($doc)) {
                foreach ($arDocs as $res => $arDoc) {
                    //                    echo $res . "\n";
                    if ($res == "str") {
                        $vegname[] = $arDoc[1];
                        $vegurl[] = $arDoc[3];
                        //                        $url[] = $arDoc[3];
                    }
                }
            } else {
                $vegname = $arDocs[1];
                $vegurl = $arDocs[3];
                $content = file_get_contents($vegurl);
                if (preg_match("~<span id=\"our_price_display\">(.+)</span>~Usi", $content, $match)) {
示例#5
0
<?php

$match_word = remwords($spell_checked);
if (preg_match("~__ipl__news_(.+)__~", $req, $match)) {
    $ipl_word = $match[1];
    $req = "__ipl__" . $ipl_word . "_";
    $options_list[] = "Fixtures Of {$ipl_word}";
    $list[] = array("content" => "__ipl__" . $ipl_word . "_fixture_");
}
if (preg_match("~__ipl__(.+)_~", $req, $match)) {
    echo "its here";
    $ipl_word = $match[1];
    echo $ipl_word . "\n";
    echo $spell_checked . "\n";
    if (strpos($ipl_word, "fixture") !== false) {
        if ($ipl_word == "fixture") {
            $query = "select * from ipl where match_date >= CURDATE()";
            $result = mysql_query($query) or trigger_error(mysql_error(), E_USER_ERROR);
            if (mysql_num_rows($result)) {
                $i = 1;
                while ($row = mysql_fetch_array($result)) {
                    $ipl_result .= "{$i}. " . $row['home_team'] . " Vs " . $row['away_team'] . " on " . date('F j', strtotime($row['match_date'])) . "," . $row['match_time'] . " " . " at " . $row['venue'] . "\n";
                    $i++;
                }
            }
        } elseif ($ipl_word == "mi_fixture" || $ipl_word == "mumbai indians_fixture") {
            $query = "select * from ipl where match_date >= CURDATE()AND (home_team='Mumbai Indians' OR away_team='Mumbai Indians')";
            $result = mysql_query($query) or trigger_error(mysql_error(), E_USER_ERROR);
            if (mysql_num_rows($result)) {
                $i = 1;
                while ($row = mysql_fetch_array($result)) {
示例#6
0
     $zodiac = array('aries', 'taurus', 'gemini', 'cancer', 'leo', 'virgo', 'scorpio', 'sagittarius', 'aquarius', 'pisces', 'libra', 'capricorn');
     echo "<br>HOROSCOPE PAKISTAN<br>";
     $total_return = "Please select your zodiac sign";
     foreach ($zodiac as $key => $ti) {
         $options_list[] = strtoupper($ti);
         $list[] = array('content' => "horoscope {$ti}");
     }
     $to_logserver['source'] = 'horoscope';
     include 'allmanip.php';
     putOutput($total_return);
     exit;
 } elseif (preg_match("~^[^\\w]*(horoscope|kismat)~", $spell_checked)) {
     $horo_must = true;
 }
 if (!preg_match("~\\b(who|where|route|direction|poem|climate|cri|score|review|train)\\b~", $spell_checked) || $horo_must) {
     $hor_req = remwords($spell_checked);
     $splited = matchdate($hor_req);
     if (isset($splited[2])) {
         $hor_req = $splited[0];
         $getdate = $splited[2];
     }
     $hor_req = preg_replace("~[^\\w\\d]~", " ", $hor_req);
     $hor_req = preg_replace("~\\b(horo?scope?|zodiac|astrology|star sign|sun sign|kismat)\\b~i", "", $hor_req);
     $hor_req = trim(preg_replace("~[\\s]+~", " ", $hor_req));
     echo "<br>{$hor_req}<br>";
     if (strlen($hor_req) > 0) {
         include 'horoscope.php';
         if ($return_zodiac) {
             $total_return = $return_zodiac;
             $source_machine = $machine_id;
             $current_file = "/temp/{$numbers}";
示例#7
0
    $q = "SELECT * FROM `ifsc` WHERE id=" . $matches[1];
    $res = mysql_query($q);
    if (mysql_num_rows($res)) {
        $r = mysql_fetch_array($res);
        $total_return = "BANK NAME: " . $r["bank_name"] . "\nIFSC CODE: " . $r["ifsc_code"] . "\nMICR CODE: " . $r["micr_code"] . "\n";
        $total_return .= "BRANCH: " . $r["branch_name"] . "\nADDRESS: " . $r["address"] . "\nCITY: " . $r["city"] . "\nDISTRICT: " . $r["district"] . "\nSTATE: " . $r["state"] . "\nCONTACT NO: " . $r["contact"];
    }
}
if (preg_match("~\\b((ifsc|micr) ?(codes?)?)\\b (.+)~", $spell_checked, $match)) {
    if (strpos($spell_checked, 'ifsc') === 0 || strpos($spell_checked, 'micr') === 0) {
        $first_IFSC = true;
    } else {
        $first_IFSC = false;
    }
    echo "ifsc query: {$spell_checked} [{$first_IFSC}]<br>";
    $ifsc_req = trim(remwords($spell_checked));
    //reemoving unwanted words
    $ifsc_req = trim(str_replace($match[1], "", $ifsc_req));
    $ifsc_req = trim(preg_replace("~[\\s]+~", " ", $ifsc_req));
    $bank_name = $district = $total_return = "";
    $options_list = $list = array();
    echo 'Printing matches<br>';
    foreach ($match as $key => $value) {
        echo "{$key} => {$value}<br>";
    }
    $codecheck = trim($match[2]);
    //first code
    echo "Code caught:  {$codecheck}<br>length: " . strlen($ifsc_req) . "<br>";
    if ($codecheck == 'ifsc' && strlen($ifsc_req) === 11) {
        //ifsc <ifsccode> entered
        echo "<br>" . ($q = "SELECT * FROM `ifsc` WHERE ifsc_code LIKE '" . $ifsc_req . "' order by id LIMIT 0 , 30");
示例#8
0
<?php

if (preg_match("~__city__(.+)__~", $req, $match)) {
    echo $spell_checked = "city " . $match[1];
}
if (!preg_match("~^city (.+)~", $spell_checked, $match)) {
    $city_word = remwords($spell_checked);
    //$hasResult=false;
    $city_word = trim(str_ireplace("'", '', $city_word));
    echo $city_word = trim(str_ireplace('city', '', $city_word));
    require_once 'binary_search.php';
    echo "<h4>CITY SEARCH</h4>";
    $tree = new BinarySearch('msi_cities', 'city', 3);
    $btime = microtime(true);
    echo $city_name = $tree->search($city_word, 1);
    //    $query = "select * from msi_cities where city like '%" . $city_word . "%' order by length(city) limit 1";
    //    $result = mysql_query($query) or trigger_error(mysql_error(), E_USER_ERROR);
    //    echo "<br>MUST SEE INDIA : $query";
    //    if (mysql_num_rows($result) > 0) {
    if (!empty($city_name)) {
        //        echo 'record in db';
        //        $row = mysql_fetch_array($result);
        //        $city_name = $row['city'];
        //    $hasResult=true;
        $options_list[] = "city {$city_name}";
        $list[] = array("content" => "__city__" . $city_name . "__");
    }
}
示例#9
0
     } else {
         if (preg_match("~([\\w\\s]+) to ([\\w\\s]+)~", $taxiStr, $match)) {
             echo '<br>Reg 3:';
             $origin = $match[1];
             $destination = $match[2];
         } else {
             if (preg_match("~([\\w\\s]+) (fro?m) ([\\w\\s]+)~", $taxiStr, $match)) {
                 echo '<br>Reg 4:';
                 $origin = $match[3];
                 $destination = $match[1];
             }
         }
     }
 }
 $origin = trim(remwords($origin));
 $destination = trim(remwords($destination));
 if (!empty($origin) && !empty($destination)) {
     echo $query = "select * from taxi_distime where SOUNDEX(origin)=SOUNDEX('" . $origin . "') and SOUNDEX(destination)=SOUNDEX('" . $destination . "') limit 0,1";
     $result = mysql_query($query) or trigger_error(mysql_error(), E_USER_ERROR);
     echo "<br>" . mysql_num_rows($result);
     if (mysql_num_rows($result) > 0) {
         $row = mysql_fetch_array($result);
         echo "<br>" . ($cityid = $row["cityid"]);
         echo "<br>" . ($distance = $row["distance"]);
         echo "<br>" . ($esttime = $row["duration"]);
     } else {
         if ($operator == "du") {
             $url = "API";
         } else {
             $url = "API";
         }
示例#10
0
if (strpos($req, "storyepd") || preg_match("~\\b((savitha|savita) (babi|bhabi|bhabbi|bhabhi))\\b~", $spell_checked)) {
    include 'episode_story.php';
}
echo "<h3>Sex Story</h3>";
echo $spell_checked;
$isSmust = false;
if (preg_match("~__sexstory_(.+)_(.+)__~", $req, $smatch)) {
    $search_sword = $smatch[1];
    $ss_id = $smatch[2];
} else {
    $search_sword = $spell_checked;
    $ss_id = 0;
}
if (strpos($spell_checked, "sex") !== false) {
    $search_sword = str_replace(",", " ", $search_sword);
    $search_sword = remwords($search_sword);
    $search_sword = preg_replace("~\\bstories\\b~", "story", $search_sword);
    $search_sword = preg_replace("~\\btip\\b~", "tips", $search_sword);
    $search_sword = preg_replace("~\\bsexy\\b~", "sex", $search_sword);
    echo "<h3>story : {$search_sword}</h3>";
    $s_return = '';
    $arLang = array("malayalam", "english", "hindi", "telugu", "assamese", "tamil", "gujarati", "urdu", "kannada", "bengali", "marathi", "oriya", "punjabi");
    if (preg_match("~(.+) sex (story|tips) (.+)~", $search_sword, $match)) {
        echo "first case";
        $isSmust = true;
        $s_type = $match[2];
        if (str_word_count($match[1]) == 1 && in_array($match[1], $arLang)) {
            $s_lang = $match[1];
            $s_category = $match[3];
        } elseif (str_word_count($match[1]) > 1) {
            $s_ar = explode(" ", $match[1]);
示例#11
0
} else {
    if (preg_match("~(movie.?time|show.?time|movie.timing)s? (for )?(.+) (in|at) (.+)~", $spell_checked, $matches)) {
        echo "<br>Matched Preg2";
        $localmovie = new LocalMovie($matches[5], $matches[3]);
        $nowrun_city = $matches[5];
        $jdial_city = $matches[5];
    } else {
        if (preg_match("~show.?times? (for )?(.+) (in|at) (.+)~", $spell_checked, $matches)) {
            echo "<br>Matched Preg3";
            $localmovie = new LocalMovie($matches[4], $matches[2]);
            $nowrun_city = $matches[4];
            $jdial_city = $matches[4];
        } else {
            if (preg_match("~(show.?time|movie.?time|movie.?timing)s?[ ;:,-]+(.+)~", $spell_checked, $matches)) {
                echo "<br>Matched Preg4";
                $search_word = trim(remwords($matches[2]));
                $arWords = explode(" ", $search_word);
                var_dump($arWords);
                foreach ($arWords as $word) {
                    echo $query = "SELECT * FROM `citylist` WHERE `city_name` LIKE '%{$word}%'";
                    $result = mysql_query($query);
                    if (mysql_num_rows($result)) {
                        $row = mysql_fetch_array($result);
                        $movie_name = trim(str_ireplace($row["city_name"], "", $matches[2]));
                        $movie_palce = $row["city_name"];
                        break;
                    }
                }
                //    if (empty($movie_palce)) {
                //        $movie_palce = $circle_city;
                //        $showcity = "Showtimes for $circle_city";
示例#12
0
<?php

if ($loc_req) {
    if (empty($place_api)) {
        include 'get_place.php';
    }
    if ($srch_item == '') {
        echo "<br>search key<br>";
        $arplace = array();
        $place_api = str_replace(",", " ", $place_api);
        $place_api = preg_replace("~\\bRd\\b~", "Road", $place_api);
        $place_api = trim(preg_replace("~[\\s]+~", " ", $place_api));
        $arplace = explode(" ", $place_api);
        var_dump($arplace);
        echo "<br>" . ($match_key = remwords($spell_checked));
        foreach ($arplace as $p_val) {
            if (stripos($match_key, $p_val) !== false) {
                echo $match_key = preg_replace("~\\b{$p_val}\\b~i", " ", $match_key);
            }
        }
        echo $match_keyword = $match_key = trim(preg_replace("~[\\s]+~", " ", $match_key));
    }
    if ($areaId > 0 && !empty($match_key)) {
        $query = "SELECT place_data.id,msg FROM place_data where key_match = '" . $match_key . "' and area=" . $areaId . " limit 0,1";
        echo "<br>{$query}<br>";
        $result = mysql_query($query) or print mysql_error() . "  in {$query}";
        if (mysql_num_rows($result)) {
            $row = mysql_fetch_array($result);
            $total_return = $row["msg"];
            $place_id = $row['id'];
        } else {
示例#13
0
<?php

if (preg_match("~\\b(sex|spicy) (story|stories)\\b~", $spell_checked) && str_word_count($spell_checked) <= 6) {
    $set_lang = '';
    unset($lang_sex);
    unset($type_sex);
    unset($title_sex);
    echo "<h1>inside the sex story</h1>";
    $query_sex = remwords($spell_checked);
    $query_sex = preg_replace("~\\b(sex|story|sexy|stories)\\b~", "", $query_sex);
    // removing sex,story,sexy,stories from query
    $query_sex_word = explode(" ", $query_sex);
    // split query into words
    // to get distinct language,title,type from table
    $lang_sex = apc_fetch('lang_sex', $success);
    echo "<h2>language dump</h2>" . var_dump($lang_sex);
    $type_sex = apc_fetch('type_sex', $type_ok);
    $title_sex = apc_fetch('title_sex', $title_ok);
    if (!$success) {
        unset($lang_sex);
        $query = "SELECT DISTINCT (`langauage`)FROM adult_content";
        $result = mysql_query($query);
        if (mysql_num_rows($result) > 1) {
            while ($row = mysql_fetch_array($result)) {
                $lang_sex[] = strtolower($row["langauage"]);
            }
        }
        apc_store('lang_sex', $lang_sex, 60480);
        // stored in cache
    }
    if (!$type_ok) {
示例#14
0
        if (!empty($row["iddcode"])) {
            $total_return .= "IDD prefix : " . $row["iddcode"] . "\n";
        }
    }
} elseif (preg_match("~\\b((isd) ?(codes?)?)\\b (.+)~", $spell_checked, $match)) {
    //if (preg_match("~^isd (codes?)? (.+)~", $spell_checked,$match)) {
    //$isdWord = trim(str_replace("isd", "", $spell_checked));
    if (strpos($spell_checked, 'isd') === 0) {
        $first_ISD = true;
    } else {
        $first_ISD = false;
    }
    echo "isd query: {$spell_checked} [{$first_ISD}]<br>";
    $isdWord = $match[4];
    //getting rest of keyword
    $isdWord = trim(remwords($isdWord));
    //removing unnecessary wordss
    /* foreach ($match as $key => $value) {
       echo "$key => $value<br>";
       } */
    //code for checking given isd code
    echo 'check for numeric<br>';
    if (is_numeric($isdWord)) {
        //isd isdcode found
        echo 'found numeric<br>';
        echo $query = "SELECT * FROM isdcode where isdcode = " . $isdWord . " order by iddcode";
        $result = mysql_query($query);
        if (mysql_num_rows($result) == 0) {
            echo $query = "SELECT * FROM isdcode where concat(isdcode,isdcode) = " . $isdWord . " order by iddcode";
            $result = mysql_query($query);
        }
示例#15
0
include 'fix_cri.php';
$savetodata = true;
$get_wans = true;
if (strlen($spell_checked) > 40) {
    //very less chance to repeat
    $savetodata = false;
} else {
    if (preg_match("~\\b(time|current|letest|last|next|age|old|news|recent|new|today|minister|president|precedent|birthday|ceo)\\b~", $spell_checked)) {
        $savetodata = false;
        $get_wans = false;
    }
}
//$savetodata = false;
$suggestions = array();
$sugg_index = 0;
$spell_keywords = remwords($spell_checked_org);
if ($savetodata) {
    $updateTable = $fetchFromOutside = false;
    echo $query = "select * from data_new1 where query = '" . mysql_real_escape_string($spell_checked) . "'";
    $result = mysql_query($query) or trigger_error(mysql_error() . " in " . $query, E_USER_ERROR);
    $history = '';
    if (mysql_num_rows($result) == 0) {
        $fetchFromOutside = true;
    } else {
        $row = mysql_fetch_array($result);
        var_dump($row);
        $confidence = $row["confidence"];
        $lastResult = $history = $row["history"];
        $oldSource = $row["source"];
        if (strlen($history) >= 99) {
            $history = substr($history, -98, 98);
示例#16
0
<?php

if (preg_match("~\\b(pincodes?|pin codes?|pin)\\b~", $spell_checked, $match)) {
    echo "input: {$spell_checked}<br>";
    if (strpos($spell_checked, 'pincode') === 0 || strpos($spell_checked, 'pincodes') === 0 || strpos($spell_checked, 'pin code') === 0 || strpos($spell_checked, 'pin codes') === 0 || strpos($spell_checked, 'pin') === 0) {
        $first_PIN = true;
    } else {
        $first_PIN = false;
    }
    echo "pin query: {$spell_checked} [{$first_PIN}]<br>";
    $pin_req = $spell_checked;
    $pin_req = trim(str_replace($match[0], "", $pin_req));
    echo "input after replace: {$pin_req}<br>";
    $pin_req = trim(preg_replace("~[\\s]+~", " ", $pin_req));
    echo "input after preg replace: {$pin_req}<br>";
    $pin_req = trim(remwords($pin_req));
    //getting unwanted words cleared
    echo "input after remove: {$pin_req}<br>";
    mysql_close();
    include 'lib/configdb2.php';
    //checking for pincode <pincode> format nmk
    if (is_numeric($pin_req)) {
        if (strlen($pin_req) == 6) {
            echo $query = "SELECT `city`,`district`,`state`,pincode FROM `pin_city`,`pin_district`,`pin_state` WHERE `pin_city`.state_id = `pin_state`.id and `pin_city`.district_id = `pin_district`.id AND `pincode`={$pin_req} order by pincode DESC LIMIT 0 , 30";
            $result = mysql_query($query);
            if (mysql_num_rows($result)) {
                while ($row = mysql_fetch_array($result)) {
                    $out .= $row["city"] . ', ' . $row["district"] . ', ' . $row["state"] . "\n";
                }
            }
        }
示例#17
0
    echo $id = $match[1];
    echo $id++;
    echo $query = "select id,chapter_title,data from story where id='{$id}'";
    $result = mysql_query($query);
    if (mysql_num_rows($result)) {
        $row = mysql_fetch_array($result);
        $story_data = $row['data'];
        $chapter_title = $row['chapter_title'];
        $id = $row['id'];
        $story_data = $chapter_title . "\n" . $story_data;
    }
    echo $total_return = $story_data;
}
if (strpos($spell_checked, "read") !== false && strpos($spell_checked, "read") == 0) {
    if (preg_match("~read(.+)~", $spell_checked, $smatch)) {
        $search_sword = remwords($smatch[1]);
        echo $search_sword;
        $count = str_word_count($search_sword);
        $search_sword1 = explode(" ", trim($search_sword));
        var_dump($search_sword1);
        $fst_word = $search_sword1[0];
        $secnd_word = trim($search_sword1[1]);
        $trd_word = $search_sword1[2];
        $search_sword = str_replace("ramayana", "", $search_sword);
        $search_sword = preg_replace("~chapter~", "", $search_sword);
        $search_sword = trim($search_sword);
        if (is_numeric($trd_word)) {
            $secnd_word = $secnd_word . " " . $trd_word;
        }
        $secnd_word = str_replace("bhagavad", "bhagavad gita", $secnd_word);
        echo $count;