Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it L'avatar di orcim
    Registrato dal
    May 2003
    Messaggi
    1,692

    [Feed RSS] Problema con pubblicazione "<pubDate>"

    Ciao a tutti.

    Ho un problema con la pubblicazione della "<pubDate>" in un pubblicazione di feed rss tramite asp e xml.

    La pubblicazione del feed avviene correttamente ma con un orario del tutto sballato, infatti pur pubblicando la giornata odierna ecco l'output in internet explorer 8:

    codice:
    Oggi 28 marzo 2012, 21 ore fa
    E questo è l'output con google chrome:
    codice:
    Wed,28 Mar 2012 00:00:00 +08:00
    Ma perchè segna 21 ore fa, se l'ultimo feed è solo di un'ora fa cioè delle 22:24:00 ????

    Posto il codice, grazie:
    codice:
    <%
    
    Session.LCID = 1040
    
    Function DateToStr(DateTime,ShowType)  
    	Dim DateMonth,DateDay,DateHour,DateMinute,DateWeek,DateSecond
    	Dim FullWeekday,shortWeekday,Fullmonth,Shortmonth,TimeZone1,TimeZone2
    	TimeZone1="+0800"
    	TimeZone2="+08:00"
    	FullWeekday=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
    	shortWeekday=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
        Fullmonth=Array("January","February","March","April","May","June","July","August","September","October","November","December")
        Shortmonth=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
    
    	DateMonth=Month(DateTime)
    	DateDay=Day(DateTime)
    	DateHour=Hour(DateTime)
    	DateMinute=Minute(DateTime)
    	DateWeek=weekday(DateTime)
    	DateSecond=Second(DateTime)
    	If Len(DateMonth)<2 Then DateMonth="0"&DateMonth
    	If Len(DateDay)<2 Then DateDay="0"&DateDay
    	If Len(DateMinute)<2 Then DateMinute="0"&DateMinute
    	Select Case ShowType
    	Case "Y-m-d"  
    		DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay
    	Case "Y-m-d H:I A"
    		Dim DateAMPM
    		If DateHour>12 Then 
    			DateHour=DateHour-12
    			DateAMPM="PM"
    		Else
    			DateHour=DateHour
    			DateAMPM="AM"
    		End If
    		If Len(DateHour)<2 Then DateHour="0"&DateHour	
    		DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&" "&DateHour&":"&DateMinute&" "&DateAMPM
    	Case "Y-m-d H:I:S"
    		If Len(DateHour)<2 Then DateHour="0"&DateHour	
    		If Len(DateSecond)<2 Then DateSecond="0"&DateSecond
    		DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&" "&DateHour&":"&DateMinute&":"&DateSecond
    	Case "YmdHIS"
    		DateSecond=Second(DateTime)
    		If Len(DateHour)<2 Then DateHour="0"&DateHour	
    		If Len(DateSecond)<2 Then DateSecond="0"&DateSecond
    		DateToStr=Year(DateTime)&DateMonth&DateDay&DateHour&DateMinute&DateSecond	
    	Case "ym"
    		DateToStr=Right(Year(DateTime),2)&DateMonth
    	Case "d"
    		DateToStr=DateDay
        Case "ymd"
            DateToStr=Right(Year(DateTime),4)&DateMonth&DateDay
        Case "mdy" 
            Dim DayEnd
            select Case DateDay
             Case 1 
              DayEnd="st"
             Case 2
              DayEnd="nd"
             Case 3
              DayEnd="rd"
             Case Else
              DayEnd="th"
            End Select 
            DateToStr=Fullmonth(DateMonth-1)&" "&DateDay&DayEnd&" "&Right(Year(DateTime),4)
        Case "w,d m y H:I:S" 
    		DateSecond=Second(DateTime)
    		If Len(DateHour)<2 Then DateHour="0"&DateHour	
    		If Len(DateSecond)<2 Then DateSecond="0"&DateSecond
            DateToStr=shortWeekday(DateWeek-1)&","&DateDay&" "& Left(Fullmonth(DateMonth-1),3) &" "&Right(Year(DateTime),4)&" "&DateHour&":"&DateMinute&":"&DateSecond&" "&TimeZone2
        Case "y-m-dTH:I:S"
    		If Len(DateHour)<2 Then DateHour="0"&DateHour	
    		If Len(DateSecond)<2 Then DateSecond="0"&DateSecond
    		DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&"T"&DateHour&":"&DateMinute&":"&DateSecond&TimeZone2
    	Case Else
    		If Len(DateHour)<2 Then DateHour="0"&DateHour
    		DateToStr=Year(DateTime)&"-"&DateMonth&"-"&DateDay&" "&DateHour&":"&DateMinute
    	End Select
    End Function
    
    Set objconn = Server.CreateObject("ADODB.Connection")
    objconn.Open "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost;PORT=3306;DATABASE=xxx;USER=xxx;PASSWORD=xxx;OPTION=3;"
    
    SQL = "SELECT SQL_CALC_FOUND_ROWS "
    SQL = SQL & " id "
    SQL = SQL & " , nome "
    SQL = SQL & " , data_ricevuto "
    SQL = SQL & "  FROM "
    SQL = SQL & "  tbl_login "
    SQL = SQL & "  WHERE 1 "
    SQL = SQL & "  order by id desc "
    SQL = SQL & "  LIMIT 1;"
    Set rs = Server.CreateObject("ADODB.RecordSet")
    rs.Open SQL, objconn
    
    If not rs.eof then
      
    strdata = rs("data_ricevuto") 
    dataOk = DateToStr(strdata,"w,d m y H:I:S")
    
    SQL = "SELECT FOUND_ROWS() x;"
    Set objRs = objconn.execute(SQL)
    
    xml = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>" & _
          "<rss version=""2.0"">" & _
          "<channel>" & _     
          "<title>Prova</title>" & _
          "<description>Prova</description>" & _
          "<link>http://www.xxxxx/feedrss/</link>" & _      
          "<language>it</language>"
    
      Do while not rs.eof
        xml = xml & "<item>"
        xml = xml & "<title>Ciao " & UCASE(rs("nome")) & "</title>"    
        xml = xml & "<description>Numero " & formatnumber(objRs("x"),0) & "</description>"  
        xml = xml & "<link>http://www.xxxxx/feedrss/</link></link>" 
        xml = xml & "<pubDate>" & dataOk & "</pubDate>"          
        xml = xml & "</item>"  
        rs.movenext
      Loop
      
      objRs.close
      set objRs=nothing
    
    End if
    
    xml = xml & "</channel></rss>"
    
    response.ContentType = "text/xml"
    response.write xml
    
    rs.close
    set rs=nothing
    
    objconn.Close
    set objconn=nothing
    %>
    "Ubi Maior, Minor Cessat"
    Domandare è lecito, rispondere è cortesia...
    A tutti è dovuta una risposta, comunque...

    “Dio gradisce molto di più le bestemmie dell’uomo disperato che non le lodi del benpensante la domenica mattina durante il culto“ Martin Lutero

  2. #2
    Utente di HTML.it L'avatar di orcim
    Registrato dal
    May 2003
    Messaggi
    1,692
    Nessuna idea ?

    "Ubi Maior, Minor Cessat"
    Domandare è lecito, rispondere è cortesia...
    A tutti è dovuta una risposta, comunque...

    “Dio gradisce molto di più le bestemmie dell’uomo disperato che non le lodi del benpensante la domenica mattina durante il culto“ Martin Lutero

  3. #3
    Utente di HTML.it L'avatar di orcim
    Registrato dal
    May 2003
    Messaggi
    1,692
    Forse non ci ho capito niente io sui feed rss...

    Allora ho scritto la pagina asp che vi ho postato e sono riuscito anche a sistemare la questione dell'orario, ecco l'output in internet explorer 8:
    codice:
    Oggi 29 marzo 2012, 1 ora fa
    E questo è l'output con google chrome:
    codice:
    <pubDate>gio, 29 mar 2012 22:38 +0200</pubDate>
    Poi mi sono registrato a questo servizio web gratuito con il quale posso pubblicare automaticamente ogni 30 minuti i feeds sul mio account twitter: http://twitterfeed.com/

    Dopo la configurazione in automatico http://twitterfeed.com/ ha pubblicato il primo feed prendendolo dalla mia pagina asp.

    Il testo del feed è il seguente in google chrome:
    <rss version="2.0">
    <channel>
    <title>Ultime notizie</title>
    <description>Ultime notizie</description>
    <link>
    http://www...../feedrss/
    </link>
    <language>it</language>
    <item>
    <title>Benvenuta/o MARIANNA</title>
    <description>
    Il tuo codice identificativo è il seguente 5.560
    </description>
    <link>
    http://www...../feedrss/
    </link>
    <pubDate>mer, 28 mar 2012 12:56 +0200</pubDate>
    </item>
    </channel>
    </rss>
    Ora il feed si è aggiornato ed il nuovo testo del feed è il seguente in google chrome:
    <rss version="2.0">
    <channel>
    <title>Ultime notizie</title>
    <description>Ultime notizie</description>
    <link>
    http://www...../feedrss/
    </link>
    <language>it</language>
    <item>
    <title>Benvenuta/o LUIGI</title>
    <description>
    Il tuo codice identificativo è il seguente 5.561
    </description>
    <link>
    http://www...../feedrss/
    </link>
    <pubDate>gio, 29 mar 2012 22:38 +0200</pubDate>
    </item>
    </channel>
    </rss>
    Nonostante ci sia un feed più recente il servizio http://twitterfeed.com/ non ha pubblicato il feed più recente ma continua a mantenere quello di ieri !!!

    Ho provato a forzare manualmente la lettura del feed, ma non c'è niente da fare.

    Per favore un'anima buona mi spiega come funzionano questi benedetti feed rss ?
    Con che tipo di criterio si aggiornano?

    Grazie
    "Ubi Maior, Minor Cessat"
    Domandare è lecito, rispondere è cortesia...
    A tutti è dovuta una risposta, comunque...

    “Dio gradisce molto di più le bestemmie dell’uomo disperato che non le lodi del benpensante la domenica mattina durante il culto“ Martin Lutero

  4. #4
    Utente di HTML.it L'avatar di orcim
    Registrato dal
    May 2003
    Messaggi
    1,692
    Adesso restituisce quest'errore:

    [feed status: Feed checked OK, no new entries found (duplicate links or GUIDs) (30 Mar 12:19) and Feed checked OK, no new entries found (duplicate links or GUIDs) (29 Mar 22:14)]
    "Ubi Maior, Minor Cessat"
    Domandare è lecito, rispondere è cortesia...
    A tutti è dovuta una risposta, comunque...

    “Dio gradisce molto di più le bestemmie dell’uomo disperato che non le lodi del benpensante la domenica mattina durante il culto“ Martin Lutero

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.