Insert dynamic content into posts

Everytime you upload a new image, the afip_new_post_content filter is called which can be used to change the post content before creation – http://wordpress.org/extend/plugins/automatic-featured-image-posts/

Assuming you have a list of URLs stored somewhere – like in the database – you need a function that would get a url from this list, then delete the url you used from that list so it doesn’t get used again.

function get_one_url(){
    /**
     * your urls would be stored somewhere I suppose. Everytime you get a url,
     * the number of URLs would decrease by one.
     */

    //this is just a sample. you could probably build this using a database call.
    $list_of_urls = array(
        "http://url1.com",
        "http://url2",
        "http://url3"
    );

    //get the first url off the list and save it to the variable $url
    $url = array_shift( $list_of_urls );

    //save new list to database. This is just a sample.
    save_my_list( $list_of_urls );

    return $url;
}


add_filter( 'afip_new_post_content', 'diww_default_post_content' );
function diww_default_post_content() {
    $url = get_one_url();
    $content = "<iframe src={$url}></iframe>";
    return $content;
}

?>