populate_item_win (Raggle::Interfaces::NcursesInterface)

    # File raggle, line 3440
          def NcursesInterface::populate_item_win(feed_id)
            item_win = $wins[NcursesInterface::get_win_id('item')]
            item_win.items.clear

            # iterate through feed items
            $config['feeds'].get(feed_id)['items'].each_with_index { |item, i|
              # take care of visibility if not yet assigned
              item['visible'] = true unless item['visible'] == false

              # can't depend on the date being in a consistent format, or
              # being defined at all, for that matter :( :( :(
              # title = item['title'] + ' (' +
              #         Time.at(item['date'].to_i).strftime(fmt) << ')'

              # build title string
              if item['date'] && item['date'].size > 0
                d_str = item['date']
                title = item['title'] ? "#{item['title'].strip} (#{d_str})" : d_str
              elsif item['title'] !~ /^\s*$/
                title = item['title'] ? item['title'].strip : ''
              elsif item['desc'] !~ /^\s*$/
                # fall back on cleaned up and truncated description if we're
                # missing a title
                w, h = item_win.dimensions
                title = item['desc'].strip.strip_tags.unescape_html.split(/\s+/).join(' ')

                if title.length > w - 5
                  title = title.slice 0, w - 5
                  title << '...'
                end
              else
                # if title is garbage and we have no description, then fall back
                # on formatted and truncated link (silly broken RSS feeds)
                title = '[' << item['url'].strip << ']'

                w, h = item_win.dimensions
                title = title.strip_tags.unescape_html.split(/\s+/).join(' ')

                if title.length > w - 5
                  title = title.slice 0, w - 5
                  title << '...'
                end
              end unless item['visible'] == false  # skip for invisible

              item_win.items << {
                'title'   => title,
                'item'    => i,
                'visible' => item['visible'],
                'read?'   => item['read?']
              } unless item['visible'] == false  # skip invisible
            }
          end