Проблемы с RSS Google

V2
На сайте с 14.02.2008
Offline
0
308

Кто какую строку запроса использует к RSS Google?

Проблема такая: такая строка не возвращает новости:

http://news.google.com/news?hl=ru&rlz=1G1GGLQ_RURU263&um=1&ie=UTF-8&tab=wn&as_drrb=q&as_qdr=d&as_mind=13&as_minm=2&as_maxd=14&as_maxm=2&output=rss&q=RU0008913751+ао ГУМ

А вот такая возвращает:

http://news.google.com/news?hl=ru&rlz=1G1GGLQ_RURU263&um=1&ie=UTF-8&tab=wn&as_drrb=q&as_qdr=d&as_mind=13&as_minm=2&as_maxd=14&as_maxm=2&output=rss&q=SIBN+Газпром нефть(ОАО)-ао

<!-- #INCLUDE FILE="GlobalSet.asp" -->

<%

'Get a value

'stockname= UCase(Trim(Request.QueryString("stockname")))

sStockname=UCase(Session("sStockname"))

sql = "SELECT [LONGNAME] FROM Table1 WHERE Code='" & Trim(sStockname) & "' and class_code in ('EQBR','EQBS', 'EQNB', 'EQNE', 'EQNL', 'EQNO', 'EQOB', 'EQOS')"

'Response.Write sql

Cmd.CommandText = sql

Cmd.CommandType = 1

RS.Open Cmd

If Not RS.EOF Then

sLongName=RS(0)

end if

RS.Close

fs_overwrite=false

set fso=Server.CreateObject("Scripting.FileSystemObject")

sFileName="c:\Inetpub\wwwroot\dc\news\"&sStockname&".txt"

if fso.FileExists(sFileName)=TRUE then

'response.write(sFileName &"-----------"&"true")

set fname=fso.OpenTextFile("c:\Inetpub\wwwroot\dc\news\"&sStockname&".txt",1,fs_overwrite)

Set f = fso.GetFile("c:\Inetpub\wwwroot\dc\news\"&sStockname&".txt")

iF_DateLastModified=f.DateLastModified

response.write "<kbd><sub>" & iF_DateLastModified & "-" & time() & "</sub></kbd>"

else

set fname=fso.CreateTextFile("c:\Inetpub\wwwroot\dc\news\"&sStockname&".txt")

if sStockname<>"" then getxml(sStockname)

end if

iHour=Hour(time())

'response.write Hour(iF_DateLastModified) & "-" & iHour & "<br>"

if sStockname<>"" then getxml(sStockname)

Function getxml(sStockname)

' Response.write("iF_DateLastModified=" & iF_DateLastModified&"<br>")

'Получить RSS и обработать по шаблону XSL

styleFile = Server.MapPath("news.xsl")

set source = Server.CreateObject("Msxml2.DomDocument")

source.async = false

source.setProperty "ServerHTTPRequest", true

source.load CStr("http://news.google.com/news?hl=ru&rlz=1G1GGLQ_RURU263&um=1&ie=UTF-8&tab=wn&as_drrb=q&as_qdr=d&as_mind=13&as_minm=2&as_maxd=14&as_maxm=2&output=rss&q=" & sStockname & "+" & sLongName)

response.write "http://news.google.com/news?hl=ru&rlz=1G1GGLQ_RURU263&um=1&ie=UTF-8&tab=wn&as_drrb=q&as_qdr=d&as_mind=13&as_minm=2&as_maxd=14&as_maxm=2&output=rss&q=" & sStockname & "+" & sLongName

set style = Server.CreateObject("Msxml2.DomDocument")

style.async = false

style.load styleFile

' source.transformNodeToObject style, response

strValue = source.transformNode(style)

set source = nothing

set style = nothing

'Получить RSS и обработать по шаблону XSL

if Hour(iF_DateLastModified)<>iHour and Len(strValue)>161 then

set fso=Server.CreateObject("Scripting.FileSystemObject")

set fname=fso.OpenTextFile("c:\Inetpub\wwwroot\dc\news\"&sStockname&".txt",2,fs_overwrite)

fname.Write(strValue)

set fs=Server.CreateObject("Scripting.FileSystemObject")

set f=fs.GetFile("c:\Inetpub\wwwroot\dc\news\" & sStockname & ".txt")

' f.Copy("c:\Inetpub\wwwroot\dc\news\" & sStockname &time() & ".txt",false)

set f=nothing

set fs=nothing

end if

end function

fs_overwrite=true

set fso=Server.CreateObject("Scripting.FileSystemObject")

set fname=fso.OpenTextFile("c:\Inetpub\wwwroot\dc\news\"&sStockname&".txt",1,fs_overwrite)

While not fname.AtEndOfStream

Response.write(fname.readline & "<BR>")

Wend

fname.Close

set fname=Nothing

set fso=Nothing

%>

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий