#!/usr/bin/env python
#############################################################################################
# Copyright 2003, Maciej "maciunio" Paczesny <maciunio (at) ask - bsi (dot) org>
#                 Lukasz "lookanio" Purgal <lookanio (at) interia (dot) pl>
#
#    This file is part of "Polish News Module".
#
#    "Polish News Module" is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    "Polish News Module" is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with "Polish News Module"; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#############################################################################################
#
# Created by StOOdi
#
import sys
path = sys.path[0]
sys.path.append(sys.path[0] + "/../../")
import feedparser
data = feedparser.parse("http://www.linux.pl/rss.php")

channel = data['channel']
items =  data['items']

# Here we can print channel name and link to main site
# getin images is possible too :)
#
#print channel['title']
#print channel['link']

# printing links to news file
#
#
news = open(path + '/newstemp', 'w')
for item in items:
    news.write(item['title']+"\n")
    news.write(item['link']+"\n")
news.close()
