How can I make links out of my PHP twitter feed output? -
i'm using simple php include grab my current twitter status , output content my website. trouble though, output doesn't generate links actual status when there urls in status.
what best or simplest way make happen?
here's php i'm using populate status:
<?php $response = new simplexmlelement('http://twitter.com/users/show/jglovier.xml',null,true); echo $response->status->text.''; ?>
*edit: since i'm front-end developer comfortable html, css, , barely js, i'm looking simplest fix here, preferably js based.
try using bcherry/twitter-text-js. autolink urls, @mentions, , #hashtags specification twitter.com uses.
put twitter-text.js on server, load after load jquery, , run snippet below on document ready.
$('p.status').each(function(index, element) { $(element).html(twttr.txt.autolink($(element).text())); });
Comments
Post a Comment