• 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?

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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.

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

    Thread Starter al3x

    (@al3x)

    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*

    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.

    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.

    However, https://blogs.msdn.com/Opml.aspx does title=””.

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

    find: xmlUrl
    replace with: htmlUrl

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘OPML Import Net Getting URIs?’ is closed to new replies.