Page 1 of 1
Link twitter user names
Posted: Fri Aug 21, 2009 2:42 pm
by Cowboy
Hello,
I found a WP plugin that automatically links twitter user names like @name in blog posts and/or comments to the user's twitter profile at twitter.com/name. Is something like that possible in s9y? The twitter plugin is not able to do this.
A second thing is link a commenter's name with his twitter profile, if it can be found via email address. I saw this in another blog, with an option box to switch linking to twitter on or off. The link was realized by a twitter icon behind the name. How can this be done in s9y?
Re: Link twitter user names
Posted: Mon Aug 24, 2009 9:47 am
by garvinhicking
Hi!
I believe you could easily do that with the "Regular Expressions" event plugin (serendipity_event_regexpmarkup). You can store a file "twitter.php" inside the plugins/serendipity_event_regexpmarkup/ directory that should look like:
Code: Select all
<?php
$regexpArray = array(
'SearchArray' => array("/@([\w]+)/i"),
'ReplaceArray'=> array('<a href="http://www.twitter.com/\1">\1</a>')
);
(I've now also committed that file to the plugin, should be available shortly in spartacus)
A second thing is link a commenter's name with his twitter profile, if it can be found via email address. I saw this in another blog, with an option box to switch linking to twitter on or off. The link was realized by a twitter icon behind the name. How can this be done in s9y?
Is that really done by email address? I think it would then require a Twitter API lookup, that could be harder to implement... Maybe we can push Grisha on this?
Regards,
Garvin
Re: Link twitter user names
Posted: Mon Aug 24, 2009 2:42 pm
by Cowboy
Hey, thanks! I'll try it with that plugin, it looks simple.
For the second question: The text box label was about "Email-Adresse zum Twitter-Profil verlinken" ("Link email address to twitter profile") The blog where I found this is styled with a new theme, in which that feature isn't implemented anymore.
Re: Link twitter user names
Posted: Wed Sep 02, 2009 8:05 pm
by blog.brockha.us
hmm.. I have to look, if I can manipulate this link. Seems to be a nice idea, to link the name with a twitter acc. If this is possible for a plugin, the microblogging plugin seems to be the right place for it.
I will have a look into that.
Re: Link twitter user names
Posted: Mon Sep 07, 2009 8:15 pm
by stm999999999
garvinhicking wrote:You can store a file "twitter.php" inside the plugins/serendipity_event_regexpmarkup/ directory that should look like:
(I've now also committed that file to the plugin, should be available shortly in spartacus)
hm, this new regex interferes with a private plugin of mine (serendipity_event_email_bot_OBFUSCATOR) witch makes mail-adresses clickable and have the possibility to obfuscate them with various methods. (in the moment I cannot publish it, because I am unsure about the licence).
But what this post is about:
in the moment I have deleted the twitter.php, but the next plugin-update it will be there again.
Would it be a good idea to have a option in the egexpmarkup-plugin to enable/disable the xxx.php-Files in the plugin directory?