%@ Language=VBScript CODEPAGE=1252%>
<%
function getMonthName(MyMonth)
Select case MyMonth
case 1
getMonthName = "Jan"
case 2
getMonthName = "Feb"
case 3
getMonthName = "Mar"
case 4
getMonthName = "Apr"
case 5
getMonthName = "May"
case 6
getMonthName = "Jun"
case 7
getMonthName = "Jul"
case 8
getMonthName = "Aug"
case 9
getMonthName = "Sep"
case 10
getMonthName = "Oct"
case 11
getMonthName = "Nov"
case 12
getMonthName = "Dec"
end Select
end function
function getDay(MyDate)
if MyDate < 10 then
getDay = 0 & MyDate
else
getDay = MyDate
end if
end function
Dim objFile
dim HeadLinesArr(5)
dim MatchArr(5)
dim FilesArr(5)
dim ThumbsArr(2)
dim ThmTxtArr(2)
dim fso
Dim strContents
Dim objRegExp
Dim objMatches
dim cnt
dim MainStoryTxt
dim ObjWeather
dim rsWeather
dim LRate
dim HRate
dim Status
set ObjWeather = new Weather
call ObjWeather.ListWeather(rsWeather)
set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(Server.MapPath("../nepras/" & year(date) & "/" & getMonthName(month(date)) & "/" & getDay(day(date)) & "/")) then
PathYear = Year(date)
PathMonth = getMonthName(month(date))
pathday = getDay(day(date))
else
PathYear = Year(date - 1)
PathMonth = getMonthName(month(date - 1))
pathday = getDay(day(date - 1))
end if
NewsPath = Server.MapPath("../nepras/" & PathYear & "/" & PathMonth & "/" & PathDay)
set d = fso.GetFolder(NewsPath)
set sd = d.files
'-------------------------------------------------------------------------
' This section is to get the latest 4 news headlines from file ADaily1.htm
'-------------------------------------------------------------------------
if fso.FileExists (NewsPath & "/ADaily1.htm") then
Set objFile = fso.OpenTextFile(NewsPath & "/ADaily1.htm")
strContents = objFile.ReadAll
objfile.close
Set objFile = Nothing
'Create a regular expression object
Set objRegExp = New RegExp
cnt = 0
TitNo = 250 'max no of headlines in the LDaily1.htm file
do while cnt < 4
objRegExp.Pattern = "(.*)"
objRegExp.IgnoreCase = True
objRegExp.Global = True
'Get the matches from the contents of our HTML file, strContents
Set objMatches = objRegExp.Execute(strContents)
if objMatches.Count > 0 then
For Each objMatch in objMatches
HeadLinesArr(cnt) = mid(objMatch.Value,instr(objMatch.Value,".") + 6)
FilesArr(cnt) = mid(objMatch.Value,instr(objMatch.Value,"""") + 1,instr(objMatch.Value,".") - instr(objMatch.Value,"""") + 3)
Next
cnt = cnt + 1
end if
TitNo = TitNo - 1
if TitNo = 0 then Exit do
loop
end if
'-------------------------------------------------------------------------
' End: section to get the latest 4 news headlines from file ADaily1.htm
'-------------------------------------------------------------------------
'-------------------------------------------------------------------------
' This section is to get the latest 2 thumbnails from file LPDaily1.htm
'-------------------------------------------------------------------------
if fso.FileExists (Server.MapPath("../nepras/" & Year(date) & "/" & getMonthName(month(date)) & "/" & getDay(day(date)) & "/APDaily1.htm")) then
ThumbPathYear = Year(date)
ThumbPathMonth = getMonthName(month(date))
Thumbpathday = getDay(day(date))
ThumbsPath = Server.MapPath("../nepras/" & Year(date) & "/" & getMonthName(month(date)) & "/" & getDay(day(date)))
else
ThumbPathYear = Year(date - 1)
ThumbPathMonth = getMonthName(month(date - 1))
Thumbpathday = getDay(day(date - 1))
ThumbsPath = Server.MapPath("../nepras/" & Year(date - 1) & "/" & getMonthName(month(date - 1)) & "/" & getDay(day(date - 1)))
end if
'response.write ThumbsPath
'response.end
'if 1 = 0 then
if fso.FileExists (ThumbsPath & "/APDaily1.htm") then
ThumbsFilePath = ThumbsPath & "/APDaily1.htm"
Set objFile = fso.OpenTextFile(ThumbsFilePath)
strContents = objFile.ReadAll
objfile.close
Set objFile = Nothing
'Create a regular expression object
Set objRegExp = New RegExp
thmcnt = 0
TitNo = 75 'max no of thmbnails in the APDaily1.htm file
do while thmcnt < 2
objRegExp.Pattern = "(.*)"
objRegExp.IgnoreCase = True
objRegExp.Global = True
'Get the matches from the contents of our HTML file, strContents
Set objMatches = objRegExp.Execute(strContents)
if objMatches.Count > 0 then
For Each objMatch in objMatches
'response.write objMatch.Value & "
"
if objMatch.Value <> "" then
ThmTxtArr(thmcnt) = mid(objMatch.Value,instr(objMatch.Value,".") + 6,instr(objMatch.Value,"") - instr(objMatch.Value,".") - 6)
end if
Next
thmcnt = thmcnt + 1
end if
TitNo = TitNo - 1
if TitNo = 0 then Exit do
loop
thmcnt = 0
TitNo = 75 'max no of thmbnails in the APDaily1.htm file
do while thmcnt < 2
objRegExp.Pattern = "(.*)"
objRegExp.IgnoreCase = True
objRegExp.Global = True
'Get the matches from the contents of our HTML file, strContents
Set objMatches = objRegExp.Execute(strContents)
if objMatches.Count > 0 then
For Each objMatch in objMatches
if objMatch.Value <> "" then
if instr(objMatch.Value,"jpg") <> 0 then
ThumbsArr(thmcnt) = mid(objMatch.Value,instr(objMatch.Value,"src") + 6,instr(objMatch.Value,"jpg") - instr(objMatch.Value,"src") -3)
end if
end if
Next
thmcnt = thmcnt + 1
end if
TitNo = TitNo - 1
if TitNo = 0 then Exit do
loop
set objRegExp = Nothing
' for i= lbound(ThmTxtArr) to ubound(ThmTxtArr)
' response.write ThmTxtArr(i) & "
"
' next
end if
'end if
'-------------------------------------------------------------------------
' End: section to get the latest 2 thumbnails from file LPDaily1.htm
'-------------------------------------------------------------------------
'--------------------------------------------
' This section is to get the currencies rates
'--------------------------------------------
'--------------------------------------------
' End section is to get the currencies rates
'--------------------------------------------
%>
|
|
|||||||||||||||||||
جميع الحقوق محفوظة لــوكالة الأنباء الأردنية 2024 |