Exemplo n.º 1
0
        break;
    }
    create_news($a[0]->href, $type);
    echo $a[0]->href . '<br />';
}
$url = 'http://www.1in.am/section/newsfeed/press';
$type = 5;
$i = 0;
$html = file_get_html($url);
$links = $html->find('div.maincol-big div.maincol-wide div.top-featured-wrapper div.category-post-main div.category-post-item');
foreach ($links as $url) {
    $v = $url->find('span.video');
    if ($v) {
        $i--;
        continue;
    }
    $a = $url->find('a');
    $i++;
    if ($i > 10) {
        break;
    }
    create_news($a[0]->href, $type);
    echo $a[0]->href . '<br />';
}
echo '
        <script type="text/javascript">
         setTimeout(function(){
            window.location.href = "http://newsroyal.com/parser_armsport.php";
         },5000);
        </script>
        ';
Exemplo n.º 2
0
        file_put_contents('upload/' . $id . '.png', $imageData);
        $insert = array('url' => $url);
        insert('post_urls', $insert);
        echo 'ok<br />';
    }
}
include "include/bd.php";
include "include/simple_html_dom.php";
$i = 0;
$url = 'http://www.panarmenian.net/arm/news/';
$type = 5;
//for($i=3;$i<20;$i++){
$html = file_get_html($url);
$links = $html->find('.single_content div.pic a');
foreach ($links as $url) {
    $i++;
    if ($i > 20) {
        break;
    }
    create_news($url->href, $type);
    echo $url->href . '<br />';
}
die;
echo '
        <script type="text/javascript">
         setTimeout(function(){
            window.location.href = "http://newsroyal.com/parser_blog.php";
         },5000);
        </script>
        ';
//}
Exemplo n.º 3
0
    $url = 'http://blognews.am/arm/news/video/';
    $type = 3;
} else {
    $url = 'http://blognews.am/arm/news/culture/';
    $type = 2;
    $red = 'p';
}
//for($i=3;$i<20;$i++){
$html = file_get_html($url);
$links = $html->find('div.newsbycatitem h3 a');
foreach ($links as $url) {
    $i++;
    if ($i > 20) {
        break;
    }
    create_news('http://blognews.am' . $url->href, $type);
    echo $url->href . '<br />';
}
if ($red) {
    echo '
        <script type="text/javascript">
         setTimeout(function(){
            window.location.href = "http://newsroyal.com/parser_blog.php?' . $red . '";
         },5000);
        </script>
        ';
} else {
    echo '
        <script type="text/javascript">
         setTimeout(function(){
            window.location.href = "http://newsroyal.com/parser_armfootball.php";
Exemplo n.º 4
0
        $imageData = file_get_contents($imageSrc);
        file_put_contents('upload/' . $id . '.png', $imageData);
        $insert = array('url' => $url);
        insert('post_urls', $insert);
        echo 'ok<br />';
    }
}
include "include/bd.php";
include "include/simple_html_dom.php";
$i = 0;
$url = 'http://armfootball.com/arm/news/';
$type = 4;
//for($i=3;$i<20;$i++){
$html = file_get_html($url);
$links = $html->find('div#homepageleftcol div#newsbycatcontainer div.newsbycatitem .newsbycattitle h1 a');
foreach ($links as $url) {
    $i++;
    if ($i > 20) {
        break;
    }
    create_news('http://armfootball.com' . $url->href, $type);
    echo $url->href . '<br />';
}
echo '
        <script type="text/javascript">
         setTimeout(function(){
            window.location.href = "http://newsroyal.com/parser_pan.php";
         },5000);
        </script>
        ';
//}
Exemplo n.º 5
0
<?php

include "../header.php";
include "../db.php";
create_news($_POST['title'], $_POST['author'], $_POST['content']);
echo "Новость успешно создана!";