WordPress.org

Ready to get started?Download WordPress

Forums

OPML Import Net Getting URIs? (8 posts)

  1. al3x
    Member
    Posted 10 years ago #

    Why would the OPML import in the Link Manager not import the URIs associated with sites in the OPML file? I'm using an export from NetNewsWire. Has anybody had a similar experience?

  2. philor
    Member
    Posted 10 years ago #

    Looks (from a very quick look at what I could find online) like NNW exports OPML like Radio's mySubscriptions.opml, which has links in two attributes, xmlUrl for the RSS feed, and htmlUrl for the web page. So if you edit link-parse-opml.php (in wp-admin), and up at the top change 'link_url' => 'URL' to 'link_url' => 'HTMLURL' it should pick up the links.
    Hmm.... how to do a map that autoswitches based on the first recognized attribute, or maybe all the attributes in the first tag....
    Shame OCS never caught on. Much nicer to have an at least slightly specified format.

  3. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Hmm, this should probably be fixed to grab whichever is available. Is there any good corpus of the different OPML variants?

  4. al3x
    Member
    Posted 10 years ago #

    Worked great with that fix, though I did have to clear out my links in the WP database 'cause there's no easy way I saw to batch delete links in the Link Manager. I wasn't able to readily find a good run-down on different OPML flavors. XML != standardization, *sigh*

  5. philor
    Member
    Posted 10 years ago #

    Ah, OPML standards.
    I was just about to submit a patch, since it worked just fine with mySubscriptions.opml-style files from NNW, SharpReader, and blo.gs, when I realized I should test it on a Radio-produced one. Oops, the rest of the world uses text="" for the blog name, and Radio uses title="". Which means my ugly recognition hack (strstr($opml, 'htmlUrl')) isn't enough, and it probably ought to be done in the parser, with actual attributes, along the lines of

    if (!$map){
    if ($attrs['htmlUrl'] && $attrs['text'] ){
    $map = $mysub_map;
    } elseif ( $attrs['htmlUrl'] && $attrs['title'] ) {
    $map = $mysub_radio_map;
    } elseif ( $attrs['url'] ) {
    $map = $opml_map;
    } // .... ad infinitum
    if ( $map ){
    // do it
    }

    Bleah.
    Um, corpus? I think one of the aggregator authors did one, maybe Dare? Probably need to search for something like "opml subscriptions #$#&%!!!1!!" - I remember swearing, lots of swearing.

  6. philor
    Member
    Posted 10 years ago #

    Oops, that wasn't a Radio file with title="". Not quite sure where it came from, but Radio does use text="" for the weblog title.

  7. philor
    Member
    Posted 10 years ago #

    However, http://blogs.msdn.com/Opml.aspx does title="".

  8. RCanine
    Member
    Posted 9 years ago #

    Just take the file into a text editor and do a find/replace:

    find: xmlUrl
    replace with: htmlUrl

Topic Closed

This topic has been closed to new replies.

About this Topic