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

import urllib.request



file = urllib.request.urlopen("http://ptwc.weather.gov/feeds/ptwc_rss_pacific.xml")    

nb = 0
nb_msg = 0
nb_lignes = 0
msg_t3 = None
val_msg_t2 = val_lat_t = val_long_t = val_based_t = 0
while nb < 2 :
    for i in file : 
        i = i.decode('utf-8')
        if i.startswith('<guid isPermaLink="false">') :
            lien = i.split('<guid isPermaLink="false">')
            lien = lien[1].split('</guid>')
            lien = lien[0]
            titre = 'Message ' + lien
            lien = 'http://ptwc.weather.gov/?region=1&id=' + lien
            print(lien)
            



                   
                   
                   
                   
                   
#"TSUNAMI WAVES ARE FORECAST TO BE LESS THAN 0.3 METERS FOR ALL OTHER COASTS COVERED BY THIS MESSAGE."                   
#"TSUNAMI WAVES ARE FORECAST TO BE MUCH LESS THAN 0.3 METERS ABOVE THE TIDE LEVEL ELSEWHERE."                   
#"TSUNAMI WAVES REACHING 1 TO 3 METERS ABOVE THE TIDE LEVEL ARE POSSIBLE ALONG SOME COASTS OF"                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
http://ptwc.weather.gov/?region=1&id=pacific.TSUPAC.2017.01.03.2259