#!/usr/bin/env python
# -*- coding:utf-8 -*-

#
# Script for displaying pretty RSS feeds
#

from sys import argv
import feedparser

# Data for parse
data = feedparser.parse(argv[1])

# Display core feed data
print "\n\033[1mFeed title:\033[0m", data.feed.title
if "description" in data.feed:
  df = data.feed.description
  if len(df) > 59:
    df = df[:59] + "..."
  print "\033[1mFeed description:\033[0m", df
print "\033[1mFeed URL:\033[0m", data.feed.link

# Display core items data
print "\n\033[1mFeed items:\033[0m\n"
for item in data.entries:
  print "  \033[1mItem title:\033[0m", item.title
  if "description" in item:
    di = item.description
    if len(di) > 55:
      di = di[:55] + "..."
    print "  \033[1mItem description:\033[0m", di
  print "  \033[1mItem link:\033[0m", item.link, "\n"
@@ -287,21 +287,23 @@
 feed:%0A  
-df = 
+if len(
 data.fee
@@ -319,20 +319,8 @@
 tion
-%0A  if len(df
 ) %3E 
@@ -332,14 +332,52 @@
    d
-f = df
+ata.feed.description = data.feed.description
 %5B:59
@@ -430,17 +430,36 @@
 3%5B0m%22, d
-f
+ata.feed.description
 %0Aprint %22
@@ -672,21 +672,23 @@
 em:%0A    
-di = 
+if len(
 item.des
@@ -699,43 +699,57 @@
 tion
-%0A    if len(di) %3E 55:%0A      di = di
+) %3E 55:%0A      item.description = item.description
 %5B:55
@@ -805,18 +805,32 @@
 33%5B0m%22, 
-d
 i
+tem.description
 %0A  print

Remove variables