1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I could use some coding help with my autoblog

Discussion in 'Blogging' started by markvd3, Oct 11, 2011.

  1. markvd3

    markvd3 Newbie

    Joined:
    Sep 29, 2011
    Messages:
    4
    Likes Received:
    0
    i use this code:

    <?php
    $i = 0;
    $page = get_the_content();
    $doc=new DOMDocument();
    $doc->loadHTML($page);
    $xml=simplexml_import_dom($doc);
    $images=$xml->xpath('//img');
    foreach ($images as $img) {
    list($width, $height, $type, $attr) = getimagesize($img['src']);

    if ($height > 149 ) {
    echo '<img src="' . $img['src'] . '" alt=" ' . $img['alt'] . ' - funny and hot pictures" title=" ' . $img['title'] . ' - funny fail picture dump" onerror=\'this.style.display="none" \'><br>';
    $i++;
    if ($i == 3 ) { break;}
    }
    else
    {
    // don't display
    }
    }
    ?>


    ... to replace the "<?php the_content(); ?> peice of code in my index and single.php files. what it does is get only images from my rss feeds and remove all of the text. what i want it do do is allow it to post youtube videos also since almost all of my feeds use both images and videos. when my feed autoposts a video the php gets broken and my wordpress theme gets all weird looking.

    can someone help me let my feeds autopost vidoes too?
     
  2. zelma143

    zelma143 Power Member

    Joined:
    Jun 25, 2010
    Messages:
    572
    Likes Received:
    37
    Occupation:
    PHP programmer,Bot maker,iMacro script maker
    this code grabing image and echo there you need to get video code and echo with embed code..
     
  3. stallion45d

    stallion45d Regular Member

    Joined:
    Oct 11, 2011
    Messages:
    497
    Likes Received:
    329
    Gender:
    Male
    are autoblogs still working?

    just asking, thank you
     
  4. CyberSEO

    CyberSEO Senior Member

    Joined:
    Jul 14, 2011
    Messages:
    959
    Likes Received:
    262
    Occupation:
    programmer
    Home Page:
    Yes, they are. Just saying :)
     
  5. adbox

    adbox Power Member

    Joined:
    May 1, 2009
    Messages:
    658
    Likes Received:
    107
    Home Page:
    An example:

    1) You have an RSS feed that contains video and image content (Is it youtube?)
    2) You are trying to auto-populate that content into your single.php page?

    Is that right?

    Have you tried any of the free video auto-posters in the meantime?
     
  6. hakme

    hakme Newbie

    Joined:
    Nov 28, 2011
    Messages:
    5
    Likes Received:
    0
    I'm also interested in this code, I want to include Youtube videos from my feeds
     
  7. alexandermp

    alexandermp Registered Member

    Joined:
    May 4, 2012
    Messages:
    61
    Likes Received:
    2
    im using feedwordpress for autoposting, but the thumnailns dont work... can we do something with the code, to make this work ?