select_item (Raggle::Interfaces::NcursesInterface)

    # File raggle, line 3547
          def NcursesInterface::select_item(item)
            desc_win = $wins[NcursesInterface::get_win_id('desc')]
            item_win = $wins[NcursesInterface::get_win_id('item')]

            # "item" refers to its place in the item window list
            # "id" refers to its place in the feed listing itself
            id = item_win.items[item]['item']

            $old_item = $a_item || 0
            $a_item = item

            # clear description window
            desc_win.active_item = 0
            desc_win.items.clear

            # get feed
            feed = $config['feeds'].get($a_feed) rescue return

            # mark item as read
            item_win.items[item]['read?'] = true
            feed['items'][id]['read?'] = true

            # redraw item window items (to mark selected item as read)
            item_win.draw_items

            # fix host-relative URLs
            # TODO: fix this stuff with URI#merge
            item_content = feed['items'][id]['desc']
            if $config['repair_relative_urls']
              # parse feed URL
              host_uri = URI::parse(feed['url'])

              item_content = item_content.gsub(/href\s*=\s*["']([^'"]+?)['"]/m) {
                m = $1.dup
                new_url = case m
                  when (/^(\w+):\/\//): m
                  else
                    # attempt to merge URI with host_uri.  if that fails,
                    # log a warning, then fall back to the unmodified string
                    begin
                      host_uri.merge(m).to_s
                    rescue
                      meth = 'NcursesInterface.select_item'
                      feed_title = feed['title']

                      $log.warn(meth) {
                        "feed \"#{feed_title}\": " +
                        _('repairing relative url failed')
                      }

                      m
                    end
                end
                "href='#{new_url}'"
              }

              # fix host-relative item URL
              item_url = feed['items'][id]['url'].dup
              item_url = case item_url
                when (/(\w+):\/\//):  item_url
                else [host_uri, item_url].join('/')
              end
            end

            # load item
            desc_win.items << {
              'content'     => item_content,
              'title'       => feed['items'][id]['title'],
              'url'         => item_url,
              'date'        => feed['items'][id]['date'],
              'read?'       => feed['items'][id]['read?'],
            }

            # redraw feed window
            NcursesInterface::populate_feed_win

            # redraw description window
            desc_win.offset = 0 unless $old_item == $a_item
            desc_win.draw_items

            # activate description window
            if (($config['focus'] == 'select' ||
                 $config['focus'] == 'select_first') &&
                !$config['no_desc_auto_focus'])
              NcursesInterface::set_active_win(get_win_id('desc'))
            end
          end