firefox:自定义wordpress博客边栏中的bit.ly链接出现404错误

firefox:自定义wordpress博客边栏中的bit.ly链接出现404错误,firefox,wordpress,twitter,hyperlink,bit.ly,Firefox,Wordpress,Twitter,Hyperlink,Bit.ly,我在博客的侧边栏上显示了twitter状态更新,其中经常有bit.ly或ow.ly链接。但每次我在firefox浏览器中点击它时,它都会给我一个404错误,因为它会尝试以下url:www.domain.com/blog/“”而不是bit.ly/uniquenumber 我刚刚检查了一下,它似乎可以在mac上的谷歌chrome上运行,但在mac os x上的firefox上却不行。还有其他人有类似的问题吗 以下是接收twitter状态更新的代码: /* These prefixes and suf

我在博客的侧边栏上显示了twitter状态更新,其中经常有bit.ly或ow.ly链接。但每次我在firefox浏览器中点击它时,它都会给我一个404错误,因为它会尝试以下url:www.domain.com/blog/“”而不是bit.ly/uniquenumber

我刚刚检查了一下,它似乎可以在mac上的谷歌chrome上运行,但在mac os x上的firefox上却不行。还有其他人有类似的问题吗

以下是接收twitter状态更新的代码:

/* These prefixes and suffixes will display before and after the entire block of tweets. */  
    $prefix = ""; // Prefix - some text you want displayed before all your tweets.  
    $suffix = ""; // Suffix - some text you want displayed after all your tweets.  
    $tweetprefix = ""; // Tweet Prefix - some text you want displayed before each tweet.  
    $tweetsuffix = "<br \><br \>"; // Tweet Suffix - some text you want displayed after each tweet.  

    $feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1" . $limit;  

    function parse_feed($feed, $prefix, $tweetprefix, $tweetsuffix, $suffix) {  

    $feed = str_replace("&lt;", "<", $feed);  
    $feed = str_replace("&gt;", ">", $feed);  
    $clean = explode("<content type=\"html\">", $feed);  

    $amount = count($clean) - 1;  

    echo $prefix;  

    for ($i = 1; $i <= $amount; $i++) {  
    echo $tweetsuffix;
    $cleaner = explode("</content>", $clean[$i]);  
    echo $tweetprefix;  
    echo $cleaner[0]; echo $suffix; echo $tweetsuffix;  ?>

    <img src="<?php echo get_bloginfo('template_directory');?>/images/side.png" alt="A line dividing the twitter updates and the open courses listing">
    <?php 
    }    
    echo $suffix;  
    }  

    $twitterFeed = file_get_contents($feed);  
    parse_feed($twitterFeed, $prefix, $tweetprefix, $tweetsuffix, $suffix); 
/*这些前缀和后缀将显示在整个tweet块之前和之后。*/
$prefix=”“;//前缀-您希望在所有tweet之前显示的一些文本。
$suffix=”“;//后缀-您希望在所有tweet之后显示的一些文本。
$tweetprefix=“”;//Tweet Prefix-希望在每次Tweet之前显示的一些文本。
$tweetsuffix=“”;//Tweet后缀-您希望在每次Tweet后显示的一些文本。
$feed=”http://search.twitter.com/search.atom?q=from:" . $用户名。“&rpp=1”$限制;
函数parse_feed($feed,$prefix,$tweetprefix,$tweetsuffix,$suffix){
$feed=str_replace(“,”,$feed);
$clean=爆炸(“,$feed);
$amount=计数($clean)-1;
echo$前缀;
对于($i=1;$i)
/images/side.png“alt=”一条分割twitter更新和开放课程列表的线“>

为您找到答案。更改此选项:

$feed = str_replace("&lt;", "<", $feed);  
$feed = str_replace("&gt;", ">", $feed);  
$feed=str_replace(“,”,$feed);
对此

$feed = str_replace("&lt;", "<", $feed);  
$feed = str_replace("&gt;", ">", $feed);  
$feed = str_replace("&quot;", '"', $feed);  
$feed=str_replace(“,”,$feed);
$feed=str_replace(“,”,$feed);

你能发布你的应用程序的确切输出吗?(即:此回响的原始源)听起来好像链接不正确。对于html链接,它必须采用以下格式:或者有机会发布推特提要的原始输出吗?谢谢David,如果你感兴趣,请查看mattbasta的答案。很高兴你能将其整理出来:)