<%@ language="VBScript" %> <% Call Print("SERVER_NAME", Request.ServerVariables("SERVER_NAME")) Call Print("PATH_INFO", Request.ServerVariables("PATH_INFO")) Dim duid, query, datepart, useOldUSInvestingArticlePage, foreignId query = Request.QueryString duid = Request.QueryString("duid") useOldUSInvestingArticlePage = false
Call Print("query", query) Call Print("duid", duid) if duid = "" then ' Send back to old site query = Replace(query, "?", "") Call Print("query", query) Call Print("RedirectURL = ", "http://go.reuters.com/financeQuoteCompanyNewsArticle.jhtml?" + query) 'remove comments from this section Response.Redirect("http://go.reuters.com/financeQuoteCompanyNewsArticle.jhtml?" + query) Response.End end if foreignId = DuidToForeignId(duid) Call Print("foreignId", foreignId) if useOldUSInvestingArticlePage then Call Print("RedirectTo", "/stocks/quotecompanynewsarticle.aspx?storyId=" + foreignId + GetRpc()) Response.Redirect("/stocks/quotecompanynewsarticle.aspx?storyId=" + foreignId + GetRpc()) Response.End else Call Print("rpcText", GetRpc()) Call Print("RedirectTo", "/news/NewsArticle.aspx?storyID=" + foreignId + "&type=comktNews" + GetRpc()) Response.Redirect("/news/NewsArticle.aspx?storyID=" + foreignId + "&type=comktNews" + GetRpc()) Response.End end if ' ' Functions ' Sub Print(name, value) Response.Write(name + " = [" + value + "]<BR>") End Sub Function DuidToForeignId(duid) dim foreignId, tempString, datePart tempString = Replace(UCase(duid), "_NEWSML", "") datePart = Replace(Mid(tempString, InStr(1, tempString, "_") + 1, 10), "-", "") + ":" Call Print("tempString", tempString) Call Print("datePart", datePart) foreignId = "urn:newsml:reuters.com:" + datePart + tempString DuidToForeignId = foreignId End Function
Function GetRpc() dim rpcText if UCase(Request.ServerVariables("SERVER_NAME")) = ".REUTERS.COM" then rpcText = "&rpc=." end if GetRpc = rpcText End Function %> |