WordPress.org

Ready to get started?Download WordPress

Forums

RSS Widget - Yahoo feed (6 posts)

  1. wristshot
    Member
    Posted 6 years ago #

    Would appreciate some help with this.

    I have set up a Yahoo RSS feed in the RSS sidebar widget. It displays the news headlines properly, but the links are bad.

    The URL for the feed is:

    http://finance.yahoo.com/rss/headline?s=ticker_symbols

    The link that is generated for each item has the following structure:

    http://us.rd.yahoo.com/finance/news/rss/story/http://biz.yahoo.com/rb/080404/story_page

    Of course, the correct address begins with the second http.

    So my questions are:

    1. Why does the Yahoo feed generate these links? Is there a different feed that generates correct links?

    2. I'm an inept coder, but I assume I can modify the rss.php file to strip the extraneous info from the URL. Anyone care to suggest the appropriate code?

    By the way, I've put up a feed from a different source and it works fine, so this seems to be a Yahoo peculiarity.

    Thanks in advance for your help!

  2. Pinoy.ca
    Member
    Posted 6 years ago #

    1. They want to track who clicks it. No, I doubt it.

    2. You don't need to, but you can use strstr($link,"*").

    Send me an ecard if this works out. :)

  3. wristshot
    Member
    Posted 6 years ago #

    Thanks, Pinoy.

    But why do you say I don't need to? As generated the links go to a 404 page. The correct link begins with the second "http".

  4. wristshot
    Member
    Posted 6 years ago #

    Pinoy, thanks again for pointing me in this direction.

    I now understand that the problem with the link is that it doesn't generate the * in front of the target URL.

    I'll post here if I can figure out how to fix. But any help would be appreciated.

  5. wristshot
    Member
    Posted 6 years ago #

    OK. Let me lay out the problem as I now (finally) understand it.

    A link generated by the Yahoo! Finance news feed in the RSS sidebar widget looks like this:

    http://us.rd.yahoo.com/finance/external/mfool/rss/SIG=1298atj6d/http://www.fool.com/investing/general/2008/04/05/a-fool-looks-back.aspx?source=eptyholnk303100&logvisit=y&npu=y&published=2008-04-05

    That link is incorrect and brings up a 404 page.

    Instead, there should be a "*" immediately prior to the target URL, like this:

    http://us.rd.yahoo.com/finance/external/mfool/rss/SIG=1298atj6d/*http://www.fool.com/investing/general/2008/04/05/a-fool-looks-back.aspx?source=eptyholnk303100&logvisit=y&npu=y&published=2008-04-05

    That link goes to the right page.

    Can anyone help me fix this? Thanks!

  6. Pinoy.ca
    Member
    Posted 6 years ago #

    I checked a few http://finance.yahoo.com/rss/headline?s=ticker_symbols and all of the links in them have asterisks, so they work as is (cf. my #2 answer).

Topic Closed

This topic has been closed to new replies.

About this Topic