If I have a URL shortener script installed in a subfolder of my status.net installation. How can I get status.net to make links out of the shortened URLS?
Specifically, I have yourls installed in a subfolder of my status.net installation. yourls is returning shortened URLs of the form a/1 where a is the name of the subfolder containing the URL shortener. However, status.net does not recognize a/1 as a URL and is not making it into a hyperlink.
Can you point me to the code I need to change to trick status.net into thinking that a/* should be a hyperlink?
Thanks!
Comments
This code belongs on util.php lines 664 through 667. I include the lines above and below so you can see where the change goes:
'(?:(?:mailto|aim|tel|xmpp):)'.
'|'.
'(?:(?:a/))'.
')'.
The quest continues...
I had to take out quite a few safety checks. Here's what I did:
1. The change above to the regex on lines 664-667 in util.php
'(?:(?:mailto|aim|tel|xmpp):)'.
'|'.
'(?:(?:a/))'.
')'.
2. Change util.php lines 788-792 to:
} else {
//throw new ServerException("Can't linkify url '$longurl_data'");
$canon = "../$url";
$longurl = "../$url";
}
3. Comment out File_redirection.php line 252:
//if (empty($p['scheme'])) return false;
4. Comment out File_redirection.php line 258:
//if (empty($p['host'])) return false;
@brionv was going to write a built in url shortener, we need one for sure.
http://gitorious.org/statusnet/mainline/commits/master
Also, for anyone else who stumbles on this post the plugin to integrate status.net with yourls is here: http://github.com/rthees/yourls-status-net
I'm not sure if you'd want to write your own URL shortener or just implement support for existing shorteners and make them part of the status.net distro.
function _canonUrl($in_url, $default_scheme = '../') {
Thanks,
~Full Mag~
http://blast.gunn.in
heres and example of how you would enable it in your config.php http://lists.status.net/pipermail/statusnet-dev/2009-November/002717.html
http://github.com/rthees/yourls-status-net
I am trying it out now. I'll post back to let you know if it worked.
Thanks,
~Full Mag~
http://blast.gunn.in
it has
require_once INSTALLDIR.'/plugins/UrlShortener/UrlShortenerPlugin.php';
but there is no UrlShortener/blah blah, in current SN.
I'm going to see if I can hack it and make it work by looking at the tight, ptit, simpleurl plugins, and what I know of my yourls installation.
tonybaldwin@tonybaldwin.me/status
tony@free-haven.org
New pluging (I changed one whole line) in https://github.com/tonybaldwin/yourls-status-net
It works with sn v. 1.0.1, pulled from gitorious today, and yourls v. 1.5
But when it comes to the watch making industry, all eyes are “watching” the choice of timepiece worn by the leader of the free world, as well as his second-in-command.
He has already made headlines around the world for his less formal approach to White House protocol, and his wardrobe reflects a younger, more casual attitude than that of his predecessor, but President Obama’s most recent choice of a watch is a bit more formal than the rest of his wardrobe. It is even issued by the government, complete with a Secret Service coat of arms.
This is because when Obama was still a senator; his Secret Service agents presented him with a black dialed chronograph. He later wore at this watch at his inauguration, making it one of the most photographed Watches in US history. The men’s watch was purchased as a gift for his 46th birthday, and came from the employee-only Secret Service store, housed in the agency’s DC headquarters.
While Obama-watchers cannot purchase the exact same men’s watwch for themselves, a similar model – the JGC 6500 – is available from Jorg Gray, the watch’s manufacturer. Of course, this one won’t have the Secret Service emblem, but who knows; maybe a replica will be released if there is significant demand.
Prior to receiving the Secret Service watch, Obama wore a TAG Heuer Divers watch, Series 1500.
Omega has the honor of naming Vice President Joseph Biden as one of their more famous fans. Biden wears an Omega Seamaster watch, with a stainless steel bracelet, featuring a precision quartz movement and water resistance of up to 1,000 feet.http://www.watchesmod.com/