douhuan1905 2014-07-03 22:58
浏览 42

Facebook上的链接RSS无效

I am using Feedwind to get RSS from a facebook page. The problem is that the generated links, when clicked, are not working properly and lead to a blank page if I am not logged on facebook, while if i am, it ask you to confirm the link to proceed. The generated address is something like this:

http://l.facebook.com/l.php?u=http%3A%2F%2Fwww.theguardian.com%2Ftravel%2F2014%2Fapr%2F25%2Fitaly-puglia-salento-region&h=9AQG93jzV&s=1

while it should be like this:

http://www.theguardian.com/travel/2014/apr/25/italy-puglia-salento-region

any thoughts on how to fix this behaviour?

  • 写回答

1条回答 默认 最新

  • duanlun2827 2014-07-03 23:34
    关注

    From what I can tell, that's the way Facebook generates its RSS feeds. Therefore, the only way to change it is to get the RSS feed data, search it for "http://l.facebook.com/l.php?u=", decode the part that follows, and replace the url of the link with the string you just created.

    $matches = array();
    pregmatchall(/http:\/\/l\.facebook\.com\/l\.php\?u=([^"]+)/, $rss, $matches);
    
    foreach($matches[0] as $index => $match) {
        $url = urldecode(html_entity_decode($matches[1][$index]));
        str_replace($match, $url, $rss);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了