%
Response.Buffer=true
response.expires=-1
set rs = Server.CreateObject("ADODB.Recordset")
filmlerimsorgusu = "SELECT TOP 20 * FROM filmlerim WHERE Imdb_Transfer_Flag is null"
rs.open filmlerimsorgusu, conn
set rs2 = Server.CreateObject("ADODB.Recordset")
rscount = "SELECT COUNT(*) AS TOTALROW FROM filmlerim WHERE Imdb_Transfer_Flag is null"
rs2.open rscount, conn
response.Write("Kalan güncellenmemis kayit sayisi:"&rs2("TOTALROW"))
response.Write("
")
while not rs.eof
response.Write(rs("ID"))
response.Write("
")
response.Flush()
Dim objXmlHttp
Dim url
Dim film_src
film_id = rs("ID")
url = rs("Imdb_Address")
Set objXmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
objXmlHttp.open "GET", url, False
objXmlHttp.send
x = objXmlHttp.ResponseText
intDummy1=InStr(x,"name=""poster""")
if intDummy1>0 then
intDummy1=InStr(intDummy1,x,"src=""")
if intDummy1>0 then
intDummy2=InStr(intDummy1+5,x,"""")
if intDummy2>0 then
length = intDummy2 - (intDummy1+5)
film_src = (mid(x,intDummy1+5,length))
end if
end if
end if
intDummy1 = InStr(x,"id=""tn15title""")
intDummy1 = InStr(intDummy1,x,"
")
intDummy2 = InStr(intDummy1+4,x,"")
length = intDummy2 - (intDummy1+4)
film_name = (mid(x,intDummy1+4,length))
film_name = Replace(film_name,"'","'")
film_name = Replace(film_name,""","")
film_name = Replace(film_name,"-","-")
intDummy1 = InStr(x,"id=""tn15title""")
intDummy1 = InStr(intDummy1,x,"")
intDummy1 = InStr(intDummy1+4,x,""">")
intDummy2 = InStr(intDummy1+2,x,"")
length = intDummy2 - (intDummy1+2)
film_year = (mid(x,intDummy1+2,length))
intDummy1 = InStr(x,"User Rating:
")
intDummy1 = InStr(intDummy1,x,"div class=""meta""")
intDummy1 = InStr(intDummy1,x,"")
intDummy2 = InStr(intDummy1+3,x,"")
length = intDummy2 - (intDummy1+3)
user_rating = (mid(x,intDummy1+3,length))
intDummy1 = InStr(x,"Director:
")
intDummy1 = InStr(intDummy1,x,"a href=""")
intDummy1 = InStr(intDummy1,x,">")
intDummy2 = InStr(intDummy1+1,x,"")
length = intDummy2 - (intDummy1+1)
director = (mid(x,intDummy1+1,length))
intDummy1 = InStr(x,"Genre:")
intDummy1 = InStr(intDummy1,x,"
")
intDummy2 = InStr(intDummy1+5,x,"")
intDummy2 = InStr(intDummy1+1,diziGenre(i),"")
length = intDummy2 - (intDummy1+1)
tempgenre = (mid(diziGenre(i),intDummy1+1,length))
if (genre <> "") then
genre = genre & "," & tempgenre
else
genre = tempgenre
end if
next
SQL="UPDATE filmlerim SET Film_Poster='"&film_src&"', Film_Name='"&film_name&"',"&_
" Film_Year='"&film_year&"', Imdb_Rating='"&user_rating&"', Genre='"&genre&"', Director='"&director&"' Imdb_Transfer_Flag=1 WHERE ID="&film_id&" "
conn.execute(SQL)
rs.moveNext
wend
rs.close
set rs = nothing
conn.close
set conn = nothing
%>