Forums

  • # May 24, 2013 at 2:01 am

    I’m getting *pretty* nitpicky here, but I’m wondering which of these is the best solution.

    Tweet content


    html5doctor says that the latter is the “officially recommended” method for citing a blockquote, but article seems more fitting for this.

    A figure is typically supposed to be something that is referenced from the main text, and since tweets are entirely separate, I’m leaning toward article for this.

    Thoughts?

    # May 24, 2013 at 2:15 am

    It’s for a WordPress theme I’m developing, so I haven’t gotten that far yet.

    I know I have a solution on my own site that works just fine (although it fails to fetch any tweets if I haven’t tweeted in awhile)

    # May 24, 2013 at 2:32 am

    function recentTweets($username, $number){

    include_once(ABSPATH.WPINC.’/rss.php’);

    $tweet = fetch_feed(“http://search.twitter.com/search.atom?q=from:” . $username . “&rpp=” . $number );

    if (!is_wp_error( $tweet ) ) :

    $maxitems = $tweet->get_item_quantity($number);

    $rss_items = $tweet->get_items(0, $maxitems);

    endif;

    if ($maxitems == 0) echo “

    Failed to load any tweets. Bummer.

    My profile

    “;

    else foreach ( $rss_items as $item ) {

    $content = html_entity_decode($item->get_content());

    $link = html_entity_decode($item->get_permalink());

    $date = $item->get_date(‘U’); // retrives the tweets date and time in Unix Epoch terms

    $blogtime = current_time(‘U’); // retrives the current browser client date and time in Unix Epoch terms

    $dago = human_time_diff($date, $blogtime) . ‘ ago’; // calculates and outputs the time past in human readable format

    Here’s the code I’m using on my site. I don’t remember where it came from.

    echo “< figure class="recent-tweet">< blockquote>$content < figcaption>$dago“;

    }

    }

    # May 24, 2013 at 2:33 am

    …Aaand that’s why I prefer bbcode to markdown

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag