I came across this nicely designed audio player on CodePen, put together by Michael Zhigulin It uses the waves.js click effect library...
PHP regular expression Twitter links
Here’s a quick piece of code to highlight replies to users in twitter for example @ashleyford this script uses regular expression to find and replace a based on two things. Firstly it checks for a space before the @ symbol and then checks for the space at the end of the users name, it then takes that string and replaces it with a link to the user twitter profile. Useful if you have a dynamic list of tweets that you want to linkify. All you need to do is change $ret to the variable the contains your string.
$ret = preg_replace("#(^|[n ])@([^ "tnr<]*)#ise", "'\1@\2'", $ret);
These two lines of code do a similar job with regards the structure however they look for the http:// and www. to determine a link.
$ret = preg_replace("#(^|[n ])([w]+?://[w]+[^ "nrt<]*)#ise", "'\1\2'", $ret);
$ret = preg_replace("#(^|[n ])((www|ftp).[^ "tnr<]*)#ise", "'\1\2'", $ret);
The post is really very nice and admire this blog.
Hey there! I know this is kinda off topic however ,
I’d figured I’d ask. Would you be interested in trading
links or maybe guest authoring a blog article or vice-versa?
My blog covers a lot of the same subjects as yours and I feel we could greatly benefit from each other.
If you’re interested feel free to send me an email. I look forward to hearing from you! Awesome blog by the way!
Almost all packaged goodies and cereals that are marketed to kids today
have this impact on them. As one facebook fan with the page Breastfeeding in Combat
Boots puts it, ‘It’s ‘taboo’ because men – by extension society
– have a hard time separating the sexual aspect of breasts from the utilitarian
purpose. what ever you choose, you also might
be an “It Girl”.
my blog – proud navy parents
Hey there! I’ve been following your site for a long time now and finally got the bravery to go ahead and give you a shout out from Houston Texas! Just wanted to mention keep up the good work!
It’s going to be ending of mine day, however before end I am reading this wonderful paragraph to improve my knowledge.
My brother suggested I might like this blog.
He was totally right. This post truly made my
day. You can not imagine just how much time I
had spent for this info! Thanks!
These are genuinely impressive ideas in about
blogging. You have touched some pleasant things here.
Any way keep up wrinting.
Somebody essentially lend a hand to make severely posts I would state.
This is the first time I frequented your website page and up to
now? I amazed with the analysis you made to make this particular post incredible.
Excellent activity!
Hi there, I log on to your blog daily. Your writing style is witty, keep
doing what you’re doing!
I was incredibly impressed from the depth of data you chose to share listed here.
Thank you for taking the time to jot down this kind of an insightful and useful piece
Hi there! I just would like to give you a huge thumbs
up for your great info you have right here on this post. I
will be coming back to your web site for more soon.
lol, ur comments ate my anchor tags 😀 haha
Easier solution for both trends (#) and users (@)
preg_replace(‘/#(w+)/’, ‘#1‘, $text)
Just swap the # with a @ if you want to link to users
Cheers
When the @user is near a dot it includes the dot in the link. Ex: This is a test of @CocaCola. (result: Sorry, that page doesn’t exist!) Can you fix that?
Okay, it broke my submitted HTML code… Another try to comment… 😉
This regex will destroy your HTML code if you have something like this:
<a href=”http://www.example.com” title=”Bla @test blubb”>Don’t break!</a>
@Dominik As the title of the tutorial explains. This Regular expression is for use with the Twitter API, It is not designed to be used with normal text with HTML in it. There is no reason for a user to type HTML code into Twitter as it will be automatically stripped out.
I need one regular expression for twitter trends links like #xxxx
Please help me!
Thanks, found this extremely useful.
Would this not be cleaner and faster:
preg_replace(“/@([A-Za-z0-9_]+) /”,”$0“,$twitter->text);