<?php header('Content-type: application/json'); $handle = fopen($_REQUEST['url'], "r"); class XmlToJson { public function Parse($url) { $fileContents = file_get_contents($url); $fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents); $fileContents = trim(str_replace('"', "'", $fileContents)); $simpleXml = simplexml_load_string($fileContents); $json = json_encode($simpleXml); return $json; } } echo XmlToJson::Parse($_REQUEST['url']);
$fileContents = trim(str_replace('"', "'", $fileContents)); $simpleXml = simplexml_load_string($fileContents); $json = json_encode($simpleXml); return $json; } } error_reporting(0); ?> <script> var arr = <?php //get from your store $url = "http://stores.inksoft.com/GetNewSession/foo"; print XmlToJson::Parse($url); ?> </script> <script> document.write("<p>Session ID: " + arr.SessionID+"</p>"); document.write("<p>sessionToken: " + arr.SessionToken+"</p>"); document.write("<p>Status: " + arr.Status+"</p>"); </script>
<?php class XmlToJson { public function Parse($url) { $fileContents = file_get_contents($url); $fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents); $fileContents = trim(str_replace('"', "'", $fileContents)); //$fileContents = str_replace('\/', '/', $fileContents); //bob fix //echo $fileContents; $simpleXml = simplexml_load_string($fileContents); $json = json_encode($simpleXml, JSON_PRETTY_PRINT); return $json; } } $xmltojson = new XmlToJson(); $js = $xmltojson->Parse('https://bugs.documentfoundation.org/show_bug.cgi?ctype=xml&id=55566'); header('Content-Type: application/json'); echo $js;
function get_sources_rss($cat_id, $start, $offset) { global $conn; $start = $start * $offset; /*$query = "select category_id, link, c1.parent from categories c1 inner join rss_news on c1.id = rss_news.category_id inner join categories c2 on c1.parent = c2.id where c2.parent = '$cat_id' and rss_news.type = 2 and rss_news.category_id = 1644 limit $start, $offset"; //rss*/ $query = "select category_id, link, c1.parent\n from categories c1\n inner join rss_news on c1.id = rss_news.category_id\n inner join categories c2 on c1.parent = c2.id\n where c2.parent = '{$cat_id}' and rss_news.type = 2 order by category_id limit {$start}, {$offset}"; //rss echo $query; //exit; $res = $conn->db_query($query); $desc = ''; $news['desc'] = ''; while ($row = $conn->fetch_assoc($res)) { $news['cid'] = $row['category_id']; if (!is_array($row['link'])) { $row['link'] = $row['link']; } else { $row['link'] = $row['link'][0]; } $row['link'] = trim($row['link']); if (strpos($row['link'], "itunes.apple.com") !== FALSE) { continue; } if (strpos($row['link'], "play.google.com") !== FALSE) { continue; } $json = XmlToJson::Parse($row['link'], false); echo '<br />$row[link]: ' . $row['link'] . '<br />'; $counter = 0; if (!isset($json['channel']['item'][0]['title'])) { //for qna القطرية $item_arr = $json['channel']['item']; unset($json['channel']['item']); $json['channel']['item'][0] = $item_arr; } // pr($json['channel']['item']); exit; foreach ($json['channel']['item'] as $item) { $counter++; // echo('c:'.is_array($item)); exit; if ($counter == 5) { break; } //last 4 news $news['title'] = $item['title']; if (is_array(@$item['link'])) { $news['url'] = $item['link'][0]; } else { $news['url'] = @$item['link']; } //$news['url'] = "http://www.charlesayoub.com/more/894078"; $news['url'] = str_replace('amp;', '&', $news['url']); $news['url'] = str_replace('amp; ', '&', $news['url']); $news['url'] = str_replace(' amp;', '&', $news['url']); $news['image'] = @$item['image'][0]; $news['url'] = str_replace("new.bab.com", "www.bab.com", $news['url']); // echo($news['image']); exit; $reversed_url = reverse_tinyurl($news['url']); if (strpos($reversed_url, "bit.ly") !== FALSE || strpos($reversed_url, "news.google.com") !== FALSE || strpos($reversed_url, "feedproxy.google.com") !== FALSE || strpos($reversed_url, "alanba.com.kw") !== FALSE || strpos($reversed_url, "eel.la") !== FALSE || strpos($reversed_url, "trib.al") !== FALSE || strpos($reversed_url, "goo.gl") !== FALSE || strpos($reversed_url, "t.co") !== FALSE || strpos($reversed_url, "fb.me") !== FALSE || strpos($reversed_url, "ow.ly") !== FALSE || strpos($reversed_url, "shar.es") !== FALSE) { $reversed_url = reverse_tinyurl($reversed_url); } if (!isset($item['title'])) { continue; } else { if (trim($item['title']) == "") { continue; } } // echo('<br />title:'); pr($item) . '<br />'; $twitter_new_id = $news['twitter_news_id'] = md5(@$item['title'] . $news['cid']); // pr($item['link']); exit; echo '<br />url_000:' . $news['url'] . '<br />'; $twitte_count = check_if_twitter_news_exists($twitter_new_id); echo '<br />$twitte_count: ' . $twitte_count . '<br />'; //echo(file_get_contents('http://petra.gov.jo/Public_News/Nws_NewsDetails.aspx?Site_Id=2&lang=1&NewsID=194030&CatID=14')); // exit; $data = ''; // exit; if (!$twitte_count) { //echo('*0*0*0*0*0*0*0*0*0*0*0*0'); pr($news); exit; if ($news['url'] != "") { if (strrpos($news['url'], 'alqabas.com.kw') !== FALSE) { $news['url'] = str_replace("Article.aspx", "Articles.aspx", $news['url']); $news['url'] = str_replace("id=", "ArticleID=", $news['url']); } if (strrpos($news['url'], 'http://www.qna.org.qa/News/NewsBulletin') !== FALSE) { $news['desc'] = $item['description']; } else { $data = fetch($news['url'], false); echo '-------------------------------------->>>>>>>>>>><br />'; pr($data); // exit; $news['desc'] = ''; } if (strrpos($news['url'], "tayyar.org") !== FALSE) { $news['image'] = @$data['images'][0]; } if ($news['image'] == "") { if (isset($item['media_content']['@attributes']['url'])) { $news['image'] = $item['media_content']['@attributes']['url']; } else { $news['image'] = @$data['images'][0]; } } else { $news['image'] = @$data['images'][0]; } if (strrpos($news['url'], "aljazeera.net") !== FALSE) { $news['url'] = explode("/", $news['url']); $last_part = urlencode($news['url'][count($news['url']) - 1]); $aljazeera_url = ''; for ($i = 0; $i < count($news['url']) - 1; $i++) { $aljazeera_url .= $news['url'][$i] . "/"; } $aljazeera_url .= $last_part; $news['url'] = $aljazeera_url; // echo($aljazeera_url); exit; } // pr($data); // exit; // if ($news['image'] == "") { // echo($news['url']); if (strrpos($news['url'], "alrafidain.org") === FALSE && strrpos($news['url'], "annaharnews.net") === FALSE && strrpos($news['url'], "elbilad.net") === FALSE && strrpos($news['url'], "alkuwaityah.com") === FALSE && strrpos($news['url'], "Alkuwaityah.com") === FALSE && strrpos($news['url'], "alqabas.com.kw") === FALSE && strrpos($news['url'], "tayyar.org") === FALSE && strrpos($news['url'], "almustagbal.com") === FALSE && strrpos($news['url'], "akhbarelyom.com") === FALSE && strrpos($news['url'], "alroya.om") === FALSE && strrpos($news['url'], "1asir.com") === FALSE && strrpos($news['url'], "alweeam.com") === FALSE && strrpos($news['url'], "alayam.com") === FALSE) { // echo('111111111111111111111111111111111');exit; if (strrpos($news['url'], "charlesayoub.com") === FALSE) { $news['url'] = str_replace(" &", "&", $news['url']); $headers = get_meta_tags(trim($news['url'])); } else { $headers = get_og_meta($news['url']); $headers['og:image'] = $headers['og:image_2']; } if (strrpos($news['url'], "alkhaleejaffairs.org") !== FALSE) { $headers = get_og_meta($news['url']); } //echo('------<br />'); pr($headers); // exit; if (isset($headers['og:image'])) { $news['image'] = $headers['og:image']; if (strpos($news['url'], "palinfo.com") !== FALSE) { $news['image'] = "https://www.palinfo.com" . $news['image']; } } else { if (isset($headers['twitter:image:src'])) { $news['image'] = $headers['twitter:image:src']; } else { if (isset($headers['twitter:image'])) { $news['image'] = $headers['twitter:image']; } else { if (!isset($headers['twitter:image:src'])) { $og_meta = get_og_meta($news['url']); //facebook // pr($og_meta); exit; if (is_array($og_meta)) { //pr($og_meta); exit; if (isset($og_meta['og:image'])) { $news['image'] = $og_meta['og:image']; } else { if (isset($og_meta['twitter:image'])) { $news['image'] = $og_meta['twitter:image']; } } } } else { // $news['image'] = ''; } } } } } // pr($headers); exit; //} echo 'urrrrrrrrrrl:' . $news['url']; echo '++++++++++++++++++++++++++++'; pr($data['paragraph']); // exit; // pr($data);exit; $count = 0; // exit; if (isset($data['paragraph'])) { foreach ($data['paragraph'] as $desc) { if (trim($desc['contents']) != "" && strpos($desc['contents'], 'اقرأ المزيد') === FALSE && strpos($desc['contents'], 'getElementById') === FALSE && strpos($desc['contents'], 'getElementsBy') === FALSE && strpos($desc['contents'], 'jQuery(function($)') === FALSE && strpos($desc['contents'], 'jQuery') === FALSE && strpos($desc['contents'], 'window') === FALSE && strpos($desc['contents'], 'document') === FALSE && strpos($desc['contents'], 'TWTR.Widget') === FALSE && strpos($desc['contents'], 'Your browser will redirect to your requested content shortly') === FALSE && strpos($desc['contents'], 'Completing the CAPTCHA proves you are a human and gives') === FALSE && strpos($desc['contents'], 'addThumbnail') === FALSE && strpos($desc['contents'], 'الأخبار العاجلةالأولىأول') === FALSE && strpos($desc['contents'], 'jQuery(function($)') === FALSE && strpos($desc['contents'], '$("') === FALSE && strpos($desc['contents'], 'updateEmailTo') === FALSE && strpos($desc['contents'], 'siteheadersponsorship') === FALSE && strpos($desc['contents'], 'Adobe Flash Player') === FALSE && strpos($desc['contents'], 'Flash Player') === FALSE && strpos($desc['contents'], 'article.title') === FALSE && strpos($desc['contents'], 'mainImage') === FALSE && strpos($desc['contents'], 'addClass') === FALSE && strpos($desc['contents'], 'ContentType: Video') === FALSE && strpos($desc['contents'], 'اسم المستخدم الى بريدك الالكتروني') === FALSE && strpos($desc['contents'], 'Internal Server Error') === FALSE && strpos($desc['contents'], 'لا يوجد تعليقات على هذا المقال') === FALSE && strpos($desc['contents'], 'You are using an outdated') === FALSE && strpos($desc['contents'], 'من نحن | اتصل بنا | المواطن الصحفي') === FALSE && strpos($desc['contents'], 'مواقع شبكة الجزيرة: الجزيرة') === FALSE && strpos($desc['contents'], 'Please upgrade your browser') === FALSE && strpos($desc['contents'], ' جميع التعليقات') === FALSE && strpos($desc['contents'], 'متصفح قديم') === FALSE && strpos($desc['contents'], 'للاستمتاع بكافة المميزات يرجى') === FALSE && strpos($desc['contents'], 'الرئيسية مركز المباريات') === FALSE && strpos($desc['contents'], 'قم بالتسجيل') === FALSE && strpos($desc['contents'], 'الوسوم') === FALSE && strpos($desc['contents'], 'جميع الحقوق') === FALSE && strpos($desc['contents'], 'جميع الحقوق محفوظة') === FALSE && strpos($desc['contents'], 'رئيس التحرير') === FALSE && strpos($desc['contents'], 'صفحتنا على فيس بوك') === FALSE && strpos($desc['contents'], 'شارك اصدقاءك') === FALSE && strpos($desc['contents'], 'شارك أصدقاءك') === FALSE && strpos($desc['contents'], 'رئاسة التحرير') === FALSE && strpos($desc['contents'], 'شريط الاخبار') === FALSE && strpos($desc['contents'], 'شريط الأخبار') === FALSE && strpos($desc['contents'], 'أخبار محلية أخبار المناطق') === FALSE && strpos($desc['contents'], 'الرئيسية الأخبار') === FALSE && strpos($desc['contents'], 'معايير البحث كل التصنيفات') === FALSE && strpos($desc['contents'], 'معايير البحث') === FALSE && strpos($desc['contents'], 'معايير البحث كل التصنيفات') === FALSE && strpos($desc['contents'], 'منوعات أخبار محلية') === FALSE && strpos($desc['contents'], 'أخبار مصر عرب وعالم') === FALSE && strpos($desc['contents'], 'حقوق النشر محفوظة') === FALSE && strpos($desc['contents'], 'الرئيسية الاخبار') === FALSE && strpos($desc['contents'], 'الرئيسية مركز المباريات') === FALSE && strpos($desc['contents'], 'function') === FALSE && strpos($desc['contents'], 'success') === FALSE && strpos($desc['contents'], 'بالفيديو والصور') === FALSE && strpos($desc['contents'], 'شؤون دينية') === FALSE && strpos($desc['contents'], 'ة في رحاب الداعية ') === FALSE && strpos($desc['contents'], 'Weather forecast') === FALSE && strpos($desc['contents'], 'يومية اخبارية') === FALSE && strpos($desc['contents'], 'من نحن') === FALSE && strpos($desc['contents'], 'أعلن معنا') === FALSE && strpos($desc['contents'], 'Powered By') === FALSE && strpos($desc['contents'], 'Powered by') === FALSE && strpos($desc['contents'], 'powered by') === FALSE && strpos($desc['contents'], 'just click') === FALSE && strpos($desc['contents'], 'Just Click') === FALSE && strpos($desc['contents'], 'Receive all') === FALSE && strpos($desc['contents'], 'via facebook') === FALSE && strpos($desc['contents'], 'password') === FALSE && strpos($desc['contents'], 'Password') === FALSE && strpos($desc['contents'], 'ترحب شبكة cnn') === FALSE && strpos($desc['contents'], 'ننصحك بمراجعة') === FALSE && strpos($desc['contents'], 'Cable News Network') === FALSE && strpos($desc['contents'], 'All Rights Reserved') === FALSE && strpos($desc['contents'], 'إقرأ المزيد') === FALSE || strrpos($news['url'], "sabr.cc") !== FALSE) { if (strrpos($news['url'], "alkhobartimes.com") === FALSE && strrpos($news['url'], "sra7h.com") === FALSE && strrpos($news['url'], "ajel.sa") === FALSE && strrpos($news['url'], "arabi21.com") === FALSE && strrpos($news['url'], "alrafidain.org") === FALSE && strrpos($news['url'], "aljubailtoday.com.sa") === FALSE) { // echo('1no dot with 2 brs'); // preg_match('/(.*)\.([^.]*)$/', $desc['contents'], $matches); //remove last dot // $desc['contents'] = str_replace(".", "<br />", @$matches[1]); //replace all dots with new line // if (strrpos($news['url'],"almowaten.net") === FALSE) { echo('2no dot with 2 brs'); //$desc['contents']=preg_split("/(?<!\..)([\?\!\.]+)\s(?!.\.)/",$desc['contents'],-1, PREG_SPLIT_DELIM_CAPTURE); // $desc['contents'] = preg_replace("/([\?\!\.]+)(?=\s+[A-Z])/", '<br />',$desc['contents']); // unset($sentences[array_search('.', $sentences)]); // $desc['contents'] = join("<br />", $desc['contents']); // } } else { // echo('dot with 2 brs'); // $desc['contents'] = str_replace(".", "<br /><br />", $desc['contents']); //replace all dots with new line } if (strpos($news['url'], "moheet.com") !== FALSE) { if (isset($desc['attributes']['style'])) { continue; } if ($desc['len'] < 100) { continue; } } /* if (strpos($news['url'], "aljazeera.net") !== FALSE) { $news['desc'] .= $desc['contents'] . " <br /><br /> "; if ($count == 6) break; } else*/ if (strpos($news['url'], "24.ae") !== FALSE) { if ($count == 0) { // pr($content); $news['desc'] .= $desc['contents'] . " <br /><br /> "; break; } $count++; } else { if (strpos($news['url'], "asir.net") !== FALSE) { if ($count == 2) { // pr($content); $news['desc'] .= $desc['contents'] . " <br /><br /> "; break; } $count++; } else { if (strpos($news['url'], "kaahe.org/ar/index") !== FALSE) { if (strpos($content['contents'], "SOURCES:") !== FALSE || strpos($content['contents'], "Copyright") !== FALSE || strpos($content['contents'], "للتحقق. HONcode نحن نلتزم بمبادئ ميثاق") !== FALSE || strpos($content['contents'], "مت الترجمة بواسطة الفريق العلمي لموسوعة") !== FALSE) { continue; } else { $news['desc'] .= $desc['contents'] . " <br /><br /> "; } } else { if (strpos($news['url'], "adpolice.gov.ae") !== FALSE) { if ($count == 0) { $count++; continue; } else { $news['desc'] .= $desc['contents'] . " <br /><br /> "; } $count++; } elseif (strpos($news['url'], "goal.com") !== FALSE || strpos($news['url'], "dw.de") !== FALSE || strpos($news['url'], "dw.com") !== FALSE || strpos($news['url'], "aleqt.com") !== FALSE || strpos($news['url'], "almaydan2.net") !== FALSE || strpos($news['url'], "alliraqnews.com") !== FALSE || strpos($news['url'], "hawaaworld.com") !== FALSE || strpos($news['url'], "attounissia.com.tn") !== FALSE || strpos($news['url'], "ahram.org.eg") !== FALSE || strpos($news['url'], "fcbarcelona.com") !== FALSE || strpos($news['url'], "al-mashhad.com") !== FALSE || strpos($news['url'], "echoroukonline.com") !== FALSE || strpos($news['url'], "steelbeauty.net") !== FALSE || strpos($news['url'], "sayidaty.net") !== FALSE || strpos($news['url'], "fashion4arab.com") !== FALSE || strpos($news['url'], "hihi2.com") !== FALSE || strpos($news['url'], "th3professional.com") !== FALSE || strpos($news['url'], "annahar.com") !== FALSE || strpos($news['url'], "hashtagarabi.com") !== FALSE || strpos($news['url'], "ounousa.com") !== FALSE || strpos($news['url'], "wafa.com.sa") !== FALSE || strpos($news['url'], "snobonline.net") !== FALSE || strpos($news['url'], "euronews.com") !== FALSE || strpos($news['url'], "wonews.net") !== FALSE || strpos($news['url'], "lahamag.com") !== FALSE || strpos($news['url'], "arabapps.org") !== FALSE || strpos($news['url'], "arabhardware.net") !== FALSE || strpos($news['url'], "android4ar.com") !== FALSE || strpos($news['url'], "wikise7a.com") !== FALSE || strpos($news['url'], "ardroid.com") !== FALSE || strpos($news['url'], "techplus.me") !== FALSE || strpos($news['url'], "ashorooq.net") !== FALSE || strpos($news['url'], "doniatech.com") !== FALSE || strpos($news['url'], "arabitechnomedia.com") !== FALSE || strpos($news['url'], "alquds.com") !== FALSE || strpos($news['url'], "arabi21.com") !== FALSE || strpos($news['url'], "hyperstage.net") !== FALSE || strpos($news['url'], "aljoumhouria.com") !== FALSE || strpos($news['url'], "arabic.sport360.com") !== FALSE || strpos($news['url'], "manchestercityfc.ae") !== FALSE || strpos($news['url'], "lana-news.ly") !== FALSE || strpos($news['url'], "alarab.qa") !== FALSE || strpos($news['url'], "beinsports.com") !== FALSE || strpos($news['url'], "linkis.com") !== FALSE || strpos($news['url'], "arriyadiyah.com") !== FALSE || strpos($news['url'], "kooora.com") !== FALSE || strpos($news['url'], "kooora2.com") !== FALSE || strpos($news['url'], "sudanmotion.com") !== FALSE || strpos($news['url'], "alnilin.com") !== FALSE || strpos($news['url'], "libyanow.net.ly") !== FALSE || strpos($news['url'], "akhbar-alkhaleej.com") !== FALSE || strpos($news['url'], "tuniscope.com") !== FALSE || strpos($news['url'], "alwatannews.net") !== FALSE || strpos($news['url'], "hibapress.com") !== FALSE || strpos($news['url'], "akhbarlibya24.net") !== FALSE || strpos($news['url'], "bahrainalyoum.net") !== FALSE || strpos($news['url'], "alwefaq.net") !== FALSE || strpos($news['url'], "bna.bh") !== FALSE || strpos($news['url'], "hespress.com") !== FALSE || strpos($news['url'], "france24.com") !== FALSE || strpos($news['url'], "bahrainmirror.no-ip.info") !== FALSE || strpos($news['url'], "al-sharq.com") !== FALSE || strpos($news['url'], "assafir.com") !== FALSE || strpos($news['url'], "tounesnews.com") !== FALSE || strpos($news['url'], "yen-news.com") !== FALSE || strpos($news['url'], "lebanondebate.com") !== FALSE || strpos($news['url'], "alkhabarnow.net") !== FALSE || strpos($news['url'], "marebpress.net") !== FALSE || strpos($news['url'], "yemen-press.com") !== FALSE || strpos($news['url'], "yemenat.net") !== FALSE || strpos($news['url'], "assabeel.net") !== FALSE || strpos($news['url'], "suhailnews.blogspot.com") !== FALSE || strpos($news['url'], "qudspress.com") !== FALSE || strpos($news['url'], "watn-news.com") !== FALSE || strpos($news['url'], "ammonnews.net") !== FALSE || strpos($news['url'], "azzaman.com") !== FALSE || strpos($news['url'], "palsawa.com") !== FALSE || strpos($news['url'], "q8news.com") !== FALSE || strpos($news['url'], "adhamiyahnews.com") !== FALSE || strpos($news['url'], "alhasela.com") !== FALSE || strpos($news['url'], "alsawt.net") !== FALSE || strpos($news['url'], "makkahnewspaper.com") !== FALSE || strpos($news['url'], "paltoday.ps") !== FALSE || strpos($news['url'], "albawabhnews.com") !== FALSE || strpos($news['url'], "alarabiya.net") !== FALSE || strpos($news['url'], "aliraqnews.com") !== FALSE || strpos($news['url'], "hattpost.com") !== FALSE || strpos($news['url'], "alhurra.com") !== FALSE || strpos($news['url'], "kuwaitnews.com") !== FALSE || strpos($news['url'], "al-balad.net") !== FALSE || strpos($news['url'], "alaraby.co.uk") !== FALSE || strpos($news['url'], "3seer.net") !== FALSE || strpos($news['url'], "alquds.co.uk") !== FALSE || strpos($news['url'], "fath-news.com") !== FALSE || strpos($news['url'], "shorouknews.com") !== FALSE || strpos($news['url'], "skynewsarabia.com") !== FALSE || strpos($news['url'], "middle-east-online.com") !== FALSE || strpos($news['url'], "akhbarak.net") !== FALSE || strpos($news['url'], "masralarabia.com") !== FALSE || strpos($news['url'], "anaween.com") !== FALSE || strpos($news['url'], "al-akhbar.com") !== FALSE || strpos($news['url'], "rudaw.net") !== FALSE || strpos($news['url'], "pal24.net") !== FALSE || strpos($news['url'], "alhayat.com") !== FALSE || strpos($news['url'], "akherkhabaronline.com") !== FALSE || strpos($news['url'], "alborsanews.com") !== FALSE || strpos($news['url'], "alikhbaria.com") !== FALSE || strpos($news['url'], "anbaaonline.com") !== FALSE || strpos($news['url'], "arn.ps") !== FALSE || strpos($news['url'], "omannews.gov.om") !== FALSE || strpos($news['url'], "elfagr.org") !== FALSE || strpos($news['url'], "almayadeen.net") !== FALSE || strpos($news['url'], "fifa.com") !== FALSE || strpos($news['url'], "arab4x4.com") !== FALSE || strpos($news['url'], "alkhabarsport.com") !== FALSE || strpos($news['url'], "safa.ps") !== FALSE || strpos($news['url'], "alkhabarkw.com") !== FALSE || strpos($news['url'], "almowaten.net") !== FALSE || strpos($news['url'], "almustaqbal.com") !== FALSE || strpos($news['url'], "youm7.com") !== FALSE || strpos($news['url'], "felesteen.ps") !== FALSE || strpos($news['url'], "layalina.com") !== FALSE || strpos($news['url'], "lebanonfiles.com") !== FALSE || strpos($news['url'], "zamanarabic.com") !== FALSE || strpos($news['url'], "nas.sa") !== FALSE || strpos($news['url'], "alwasat.com.kw") !== FALSE || strpos($news['url'], "saidaonline.com") !== FALSE || strpos($news['url'], "nok6a.net") !== FALSE || strpos($news['url'], "arabic.cnn.com") !== FALSE || strpos($news['url'], "ng4a.com") !== FALSE || strpos($news['url'], "alkhaleejonline.net") !== FALSE || strpos($news['url'], "dostor.org") !== FALSE || strpos($news['url'], "almotamar.net") !== FALSE || strpos($news['url'], "qna.org.qa") !== FALSE || strpos($news['url'], "euronews") !== FALSE || strpos($news['url'], "3alyoum.com") !== FALSE || strpos($news['url'], "autosearch.me") !== FALSE || strpos($news['url'], "n1t1.com") !== FALSE || strpos($news['url'], "arabsturbo.com") !== FALSE || strpos($news['url'], "elfann.com") !== FALSE || strpos($news['url'], "qabaq.com") !== FALSE || strpos($news['url'], "android-time.com") !== FALSE || strpos($news['url'], "anazahra.com") !== FALSE || strpos($news['url'], "arbdroid.com") !== FALSE || strpos($news['url'], "goodykitchen.com") !== FALSE || strpos($news['url'], "q8ping.com") !== FALSE || strpos($news['url'], "shahiya.com") !== FALSE || strpos($news['url'], "forbesmiddleeast.com") !== FALSE || strpos($news['url'], "sea7htravel.com") !== FALSE || strpos($news['url'], "alayam.com") !== FALSE || strpos($news['url'], "yumyume.com") !== FALSE || strpos($news['url'], "hiamag.com") !== FALSE || strpos($news['url'], "akhbarelyom.com") !== FALSE || strpos($news['url'], "mubasher.info") !== FALSE || strpos($news['url'], "alittihad.ae") !== FALSE || strpos($news['url'], "ismailyonline.com") !== FALSE || strpos($news['url'], "olympic.qa") !== FALSE || strpos($news['url'], "masrawy.com") !== FALSE || strpos($news['url'], "al-gornal.com") !== FALSE || strpos($news['url'], "cdn.alkass.net") !== FALSE || strpos($news['url'], "buyemen.com") !== FALSE || strpos($news['url'], "zamalekfans.com") !== FALSE || strpos($news['url'], "alahlyegypt.com") !== FALSE || strpos($news['url'], "alriadey.com") !== FALSE || strpos($news['url'], "elheddaf.com") !== FALSE || strpos($news['url'], "alwasatnews.com") !== FALSE || strpos($news['url'], "goalna.com") !== FALSE || strpos($news['url'], "elwatannews.com") !== FALSE || strpos($news['url'], "al-jazirah.com") !== FALSE || strpos($news['url'], "sabqq.org") !== FALSE || strpos($news['url'], "sport.ahram.org") !== FALSE || strpos($news['url'], "tracksport.net") !== FALSE || strpos($news['url'], "tayyar.org") !== FALSE || strpos($news['url'], "elaph.com") !== FALSE || strpos($news['url'], "Elaph") !== FALSE || strpos($news['url'], "alriyadh.com") !== FALSE || strpos($news['url'], "alsopar.com") !== FALSE || strpos($news['url'], "ittinews.net") !== FALSE || strpos($news['url'], "elaph") !== FALSE || strpos($news['url'], "realmadrid.com") !== FALSE || strpos($news['url'], "ar.beinsports.net") !== FALSE || strpos($news['url'], "GalerieArtciles") !== FALSE || strpos($news['url'], "hilalcom.net") !== FALSE || strpos($news['url'], "filgoal.com") !== FALSE || strpos($news['url'], "yallakora.com") !== FALSE || strpos($news['url'], "mbc.net") !== FALSE || strpos($news['url'], "aljazeera.net") !== FALSE || strpos($news['url'], "ajialq8.com") !== FALSE || strpos($news['url'], "oleeh.com") !== FALSE || strpos($news['url'], "alshamiya-news.com") !== FALSE || strpos($news['url'], "alrayalaam.com") !== FALSE || strpos($news['url'], "alkoutnews.net") !== FALSE || strpos($news['url'], "almashhad.net") !== FALSE || strpos($news['url'], "alsawtnews.cc") !== FALSE || strpos($news['url'], "acakuw.com") !== FALSE || strpos($news['url'], "dasmannews.com") !== FALSE || strpos($news['url'], "reqaba.com") !== FALSE || strpos($news['url'], "aldostornews.com") !== FALSE || strpos($news['url'], "annaharkw.com") !== FALSE || strpos($news['url'], "altaleea.com") !== FALSE || strpos($news['url'], "filwajiha.com") !== FALSE || strpos($news['url'], "arabesque.tn") !== FALSE || strpos($news['url'], "alhakea.com") !== FALSE || strpos($news['url'], "kuna.net.kw") !== FALSE || strpos($news['url'], "ennaharonline.com") !== FALSE || strpos($news['url'], "alanba.com.kw") !== FALSE || strpos($news['url'], "elbilad.net") !== FALSE || strpos($news['url'], "alkuwaityah.com") !== FALSE || strpos($news['url'], "Alkuwaityah.com") !== FALSE || strpos($news['url'], "al-seyassah.com") !== FALSE || strpos($news['url'], "chouftv.ma") !== FALSE || strpos($news['url'], "mmaqara2t.com") !== FALSE || strpos($news['url'], "tnntunisia.com") !== FALSE || strpos($news['url'], "annaharnews.net") !== FALSE || strpos($news['url'], "moroccoeyes") !== FALSE || strpos($news['url'], "babnet.net") !== FALSE || strpos($news['url'], "atheer.om") !== FALSE || strpos($news['url'], "alyaoum24.com") !== FALSE || strpos($news['url'], "le360.ma") !== FALSE || strpos($news['url'], "tunisien.tn") !== FALSE || strpos($news['url'], "shabiba.com") !== FALSE || strpos($news['url'], "alforatnews.com") !== FALSE || strpos($news['url'], "alwatan.com") !== FALSE || strpos($news['url'], "tounessna.info") !== FALSE || strpos($news['url'], "futuretvnetwork.com") !== FALSE || strpos($news['url'], "zoomtunisia.tn") !== FALSE || strpos($news['url'], "lbcgroup.tv") !== FALSE || strpos($news['url'], "omandaily.om") !== FALSE || strpos($news['url'], "al-watan.com") !== FALSE || strpos($news['url'], "nna-leb.gov.lb") !== FALSE || strpos($news['url'], "moe.gov.qa") !== FALSE || strpos($news['url'], "orient-news.net") !== FALSE || strpos($news['url'], "otv.com.lb") !== FALSE || strpos($news['url'], "syrianow.sy") !== FALSE || strpos($news['url'], "almanar.com.lb") !== FALSE || strpos($news['url'], "lebwindow.net") !== FALSE || strpos($news['url'], "sahelmaten.com") !== FALSE || strpos($news['url'], "basnews.com") !== FALSE || strpos($news['url'], "o-t.tv") !== FALSE || strpos($news['url'], "iraqdirectory.com") !== FALSE || strpos($news['url'], "assawsana.com") !== FALSE || strpos($news['url'], "alnoornews.net") !== FALSE || strpos($news['url'], "etilaf.org") !== FALSE || strpos($news['url'], "elshaab.org") !== FALSE || strpos($news['url'], "alrafidain.org") !== FALSE || strpos($news['url'], "alroeya.ae") !== FALSE || strpos($news['url'], "hroobnews.com") !== FALSE || strpos($news['url'], "argaam.com") !== FALSE || strpos($news['url'], "wam.ae") !== FALSE || strpos($news['url'], "albayan.ae") !== FALSE || strpos($news['url'], "royanews.tv") !== FALSE || strpos($news['url'], "almesryoon.com") !== FALSE || strpos($news['url'], "yanair.net") !== FALSE || strpos($news['url'], "almogaz.com") !== FALSE || strpos($news['url'], "egyptiannews.net") !== FALSE || strpos($news['url'], "maqar.com") !== FALSE || strpos($news['url'], "alamalmal.net") !== FALSE || strpos($news['url'], "7iber.com") !== FALSE || strpos($news['url'], "el-balad.com") !== FALSE || strpos($news['url'], "jn-news.com") !== FALSE || strpos($news['url'], "jo24.net") !== FALSE || strpos($news['url'], "wikise7a") !== FALSE || strpos($news['url'], "addustour.com") !== FALSE || strpos($news['url'], "klmty.net") !== FALSE || strpos($news['url'], "alarabalyawm.net") !== FALSE || strpos($news['url'], "rotanamags.net") !== FALSE || strpos($news['url'], "kaahe.org") !== FALSE || strpos($news['url'], "lahaonline.com") !== FALSE || strpos($news['url'], "3eesho.com") !== FALSE || strpos($news['url'], "almaghribtoday.net") !== FALSE || strpos($news['url'], "dailymedicalinfo.com") !== FALSE || strpos($news['url'], "almasryalyoum.com") !== FALSE || strpos($news['url'], "arabi21.com") !== FALSE || strpos($news['url'], "ham-24.com") !== FALSE || strpos($news['url'], "al-madina.com") !== FALSE || strpos($news['url'], "anbaanews.com") !== FALSE || strpos($news['url'], "almuraba.net") !== FALSE || strpos($news['url'], "aldawadmi.net") !== FALSE || strpos($news['url'], "hafralbaten.com") !== FALSE || strpos($news['url'], "naseej.net") !== FALSE || strpos($news['url'], "newsqassim.com") !== FALSE || strpos($news['url'], "nwafecom.net") !== FALSE || strpos($news['url'], "adwaalwatan.com") !== FALSE || strpos($news['url'], "ajel.sa") !== FALSE || strpos($news['url'], "fajr.sa") !== FALSE || strpos($news['url'], "arjja.com") !== FALSE || strpos($news['url'], "aljubailtoday.com.sa") !== FALSE || strpos($news['url'], "twasul.info") !== FALSE || strpos($news['url'], "spa.gov.sa") !== FALSE || strpos($news['url'], "mini-news.net") !== FALSE || strpos($news['url'], "almjardh.com") !== FALSE || strpos($news['url'], "rasdnews.net") !== FALSE || strpos($news['url'], "aljouf-news.com") !== FALSE || strpos($news['url'], "zahran.org") !== FALSE || strpos($news['url'], "alshahedkw.com") !== FALSE || strpos($news['url'], "tabuk-news.com") !== FALSE || strpos($news['url'], "alkhaleejaffairs.org") !== FALSE || strpos($news['url'], "asir.com") !== FALSE || strpos($news['url'], "rsssd.com") !== FALSE || strpos($news['url'], "roaanews.net") !== FALSE || strpos($news['url'], "kharjhome.com") !== FALSE || strpos($news['url'], "asir.net_xxxxxx") !== FALSE || strpos($news['url'], "cma.org.sa") !== FALSE || strpos($news['url'], "baareq.com.sa") !== FALSE || strpos($news['url'], "saso.gov.sa") !== FALSE || strpos($news['url'], "freeswcc.com") !== FALSE || strpos($news['url'], "moh.gov.sa") !== FALSE || strpos($news['url'], "reuters.com") !== FALSE || strpos($news['url'], "sabq.org") !== FALSE || strpos($news['url'], "raialyoum.com") !== FALSE || strpos($news['url'], "alsharq.net.sa") !== FALSE || strpos($news['url'], "ar.yabiladies.com") !== FALSE || strpos($news['url'], "paltimes.net") !== FALSE || strpos($news['url'], "palinfo.com") !== FALSE || strpos($news['url'], "electrony.net") !== FALSE || strpos($news['url'], "electronynet") !== FALSE || strpos($news['url'], "naba.ps") !== FALSE || strpos($news['url'], "alkhaleej.ae") !== FALSE || strpos($news['url'], "alwasat.ly") !== FALSE || strpos($news['url'], "alrakoba.net") !== FALSE || strpos($news['url'], "charlesayoub.com") !== FALSE || strpos($news['url'], "aljadeed.tv") !== FALSE || strpos($news['url'], "aawsat.com") !== FALSE || strpos($news['url'], "dotmsr.com") !== FALSE || strpos($news['url'], "alqabas.com.kw") !== FALSE || strpos($news['url'], "aljarida.com") !== FALSE || strpos($news['url'], "sabr.cc") !== FALSE || strpos($news['url'], "alwatan.kuwait.tt") !== FALSE || strpos($news['url'], "alraimedia.com") !== FALSE || strpos($news['url'], "14march.org") !== FALSE) { if ($count == 0) { // echo ('kkkkkkkkkkkkkkkkkkkkkkkkk');pr($desc); exit; $news['desc'] .= $desc['contents'] . " <br /><br /> "; break; } $count++; } else { if (strpos($news['url'], 'alalam.ir') !== FALSE) { if ($count == 2) { if (strpos($desc['contents'], 'Shadowbox.init') !== FALSE) { $no_text1 = true; $count++; continue; } } elseif ($count == 3) { if (strpos($desc['contents'], 'Shadowbox.init') !== FALSE) { $no_text = true; $count++; continue; } } else { if ($count == 3 && isset($no_text1)) { $news['desc'] = ''; $news['desc'] .= $desc['contents'] . " <br /><br /> "; break; } else { if ($count == 4 && isset($no_text)) { $news['desc'] = ''; $news['desc'] .= $desc['contents'] . " <br /><br /> "; break; } else { $news['desc'] .= $desc['contents'] . " <br /><br /> "; } } } $count++; } else { if (strpos($news['url'], "yemen-press.net") !== FALSE || strpos($news['url'], "ajmanpolice.gov") !== FALSE || strpos($news['url'], "alsumaria.tv") !== FALSE) { if ($count == 0) { // pr($content); $news['desc'] .= $desc['contents'] . " <br /><br /> "; break; } $count++; } else { if (strpos($news['url'], "almayadeen.net") !== FALSE) { /* if ($count == 3){ // pr($content); $news['desc'] .= $content['contents'] . " <br /><br /> "; break; } $counter++; */ /* if (strpos($news['url'], "/news/") !== FALSE) { $news['desc'] .= $desc['contents'] . " <br /><br /> "; } else{ $news['desc'] = ""; } */ } else { $news['desc'] .= $desc['contents'] . " <br /><br /> "; } } } } } } } $count++; } } } if (strpos($news['url'], 'rsssd.com') !== false) { $news['title'] = $data['title']; } if (strpos($news['url'], 'kharjhome.com') !== false) { $data['title'] = iconv('windows-1256', 'UTF-8', $data['title']); $news['title'] = $data['title']; } echo '......................................>>>>>>>>>>'; pr($news); // exit; if (strpos($news['url'], 'fb.me') !== false || strpos($news['url'], 'facebook.com') !== false) { $news['desc'] = "go to fb"; $news['image'] = ""; } else { if (strpos($news['url'], 'media.5d3a.com') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'altibbi.com') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], '/vb/') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'dmi.ae/samadubai') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'alg360.com') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'instagram.com') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'zakatfund.gov.ae') !== false || strrpos($reversed_url, "zf.ae") !== FALSE) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'ittisport.com') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'dcndigital.ae') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'youtube.com') !== false || strpos($news['url'], 'youtu.be') !== false) { $news['desc'] = "go to youtube"; $news['image'] = ""; } else { if (strpos($news['url'], 'audio.islamweb.net') !== false || strpos($news['url'], 'youtu.be') !== false) { $news['desc'] = "go to islamweb"; } else { if (strpos($news['url'], 'vine.co') !== false) { $news['desc'] = "go to fb"; } else { if (strpos($news['url'], 'fitnessyard.com/registration') !== false) { $news['desc'] = ""; } else { if (strpos($news['url'], 'fitnessyard.com/workout/exercise-directory') !== false) { $news['desc'] = ""; } else { if (strpos($news['url'], '3eesho.com/articles/browse/category') !== false) { $news['desc'] = ""; } else { if (strpos($news['url'], '.pdf') !== false) { $news['desc'] = "go to pdf"; } else { if (strpos($news['url'], 'twitter.com') !== false) { continue; } } } } } } } } } } } } } } } } } } } else { $news['desc'] = 'url not set'; } // exit; //echo('......................................>>>>>>>>>>'); pr($news['desc']); exit; save_news($news, $data, $reversed_url); } echo '<br />-----------------------------------------------------------------------------<br />'; //pr($news); sleep(5); } } }
<HEAD> <LINK rel="stylesheet" href="css/style.css"> </HEAD> <BODY> <div id="full-size"> <div id="wrapper"> <?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ include 'XmlToJson.php'; $json = XmlToJson::Parse("https://api.flickr.com/services/feeds/photos_public.gne?tags=chamonix,ski,snow"); $pictures = json_decode($json, true); foreach ($pictures['entry'] as $singlePic) { $author = $singlePic['author']['name']; $title = $singlePic['title']; $link = $singlePic['link'][1]['@attributes']['href']; $imagelink = $singlePic['link']; //this link goes to author's conections, we need author's pictures $peoplePage = $singlePic['author']['uri']; $authorPage = str_replace('people', 'photos', $peoplePage); ?> <ul id="grid"> <li><a href="<?php echo $authorPage;