I have some code help.

<?php
error_reporting(0);
//$cat = $_POST['cat'];
$uri = 'http://ventureburn.com/feed/';
$xml = simplexml_load_file($uri);
$namespaces = $xml->getNamespaces(true); 
$i = 0;
$data = '';

//echo '<pre>';
//print_r($xml);
//echo '</pre>';
// exit;



    $string = str_replace(array('[\', \']'), '', $string);
    $string = preg_replace('/\[.*\]/U', '', $string);
    $string = preg_replace('/&(amp;)?#?[a-z0-9]+;/i', '-', $string);
    $string = htmlentities($string, ENT_COMPAT, 'utf-8');
    $string = preg_replace('/&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);/i', '\\1', $string );
    $string = preg_replace(array('/[^a-z0-9]/i', '/[-]+/') , '-', $string);
    return strtolower(trim($string, '-'));
}


$conn = new Mongo("mongodb://mysettings");
$db = $conn->recommendly;
$collection = $db->svtracker_feeds;
$cursor = $collection->count();
$orderid = $cursor + 1;
$decrData = '';



//$db->createCollection("efactor_feeds");
foreach($xml->children() as $child) {

    foreach($child->item as $child1) {
//if($i == 1){
        echo $titleTxt = (string)$child1->title;
        echo '<br>';

        $child1->children($namespaces['media'])->content->attributes()->url;
       echo '<br>';
        echo $description1 = $child1->description;


        // $description = substr($description2,0,160).'...';
       //  echo '<br>';
       // echo '<br>';
        // $enclosure = $child1->enclosure;
        // $imgSrc = $enclosure['url'][0];
        // $imgSrc2 = (string)$imgSrc;
        // $imgSrc3 = substr($imgSrc2, 0, -8);
        // $imgSrc1 = $imgSrc3.'large.jpg';
      echo '<br><br>';

        $link = (string)$child1->link;
        $permalink_id = md5($link);
        $date = (string)$child1->pubDate;
        //$date = date("D, d M Y g:i:s e");//'Tue, 05 Aug 2014 10:45:45 GMT';
        $post_author = '';
        $seoCapt = seo_friendly_url($titleTxt);



$start = strtotime(gmdate("d-M-Y 00:00:00"));
$end = strtotime(gmdate("d-M-Y 11:59:59"));
$ori_date = strtotime($date);
//if( ($ori_date > $start) && ($ori_date < $end) ){
//if($i == 0){
//$db->svtracker_feeds->insert( array("source" => 'huffingtonpost', "category" => 'startups', "title" => $titleTxt, "description" => $description, "original_link" => $link, "image_src" => $imgSrc1, "permalink_id" => $permalink_id, "post_date" => $date, "post_author" => $post_author, "status" => '1', "orderid" => $orderid,"view" => 0, "fbshare" => 0, "twtshare" => 0, "totalcount" => 0, "srtime" => $ori_date, "permalink_content" => $decrDataMn, "seo_title" => $seoCapt, "perma_cont_status" => 1) );    
//}
$orderid++;
//}
//$orderid++;
$decrData = '';
$i++;
    }
}

?>

this is my code. I want imges crawing code to easily collect whole page info about title description,images with link.

almostbob commented: theft is such a bad way to begin -3

Recommended Answers

All 2 Replies

This is called theft
very poor form
If you had permission to aquire these images, you would have the owner's sqldb or rss feed
The people here are more likely to be authors than theives
go back under the rock you crawled out of

I am kinda lost what the question is...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.