|

Exercise for the Brain
Fire Thoughts Blog

<%
' ********************************************************************
' Paste this block of code on the web page where you would like your
' article directory to be displayed. This code will dynamically create
' your article directory based on your GetMyArticles.com settings.
' ********************************************************************
' ********************************************************************
' **********Please DO NOT modify anything below this line*************
' ********************************************************************
Dim GMAKey
Dim GMAPage
Dim GMAS
Dim GMAQ
Dim GMAError
Dim GMAResult
Dim Action
Dim ReqType
GMAKey = "EFP4-VSF6-6E64"
GMAPage = Request.ServerVariables("SCRIPT_NAME")
ReqType = "GET"
' # Generate the data to post to the GetMyArticles.com server
GMAS = "&script=asp"
GMAS = GMAS & "&Key=" & GMAKey
GMAS = GMAS & "&ScriptName=" & GMAPage
' # pass through any querystring data to GetMyArticles.com to allow paging
If Request.Form("action") = "submitnewart" Then
GMAQ = Request.Form
Action = "submitnewart"
ReqType = "POST"
Else
GMAQ = Request.QueryString
Action = Request.QueryString("action")
End If
' ---------------------------------------------------------------------------------
Function GetMyArticlesData(HTTPQuery, PostStr, ByRef Resp, ByRef Er, ReqMet)
Dim HttpReqObj
Dim ComponentString
Set HttpReqObj = Nothing
On Error Resume Next
Set HttpReqObj = CreateObject("WinHttp.WinHttpRequest.5.1")
On Error Resume Next
If HttpReqObj Is Nothing Then Set HttpReqObj = CreateObject("WinHttp.WinHttpRequest.5") End If
On Error Resume Next
If HttpReqObj Is Nothing Then
On Error Resume Next
Set HttpReqObj = CreateObject("Msxml2.ServerXMLHTTP")
On Error Resume Next
If HttpReqObj Is Nothing Then
Set HttpReqObj = CreateObject("Msxml2.ServerXMLHTTP.4.0")
End If
On Error Resume Next
If HttpReqObj Is Nothing Then
Set HttpReqObj = CreateObject("Microsoft.XMLHTTP")
End If
On Error Resume Next
If HttpReqObj Is Nothing Then
Er = "HTTP requests not supported."
GetMyArticlesData = False
Else
HttpReqObj.open ReqMet, "http://getmyarticles.com/engine.php?" & HTTPQuery & PostStr, false
If ReqMet = "POST" Then
HttpReqObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
End If
HttpReqObj.Send
If HttpReqObj.status <> 200 Then
Er = "Error: Status=" & HttpReqObj.status & " Text='" & HttpReqObj.responseText & "'"
GetMyArticlesData = False
Else
Resp = ComponentString & HttpReqObj.responseText
GetMyArticlesData = True
End If
Set HttpReqObj = Nothing
End If
Else
HttpReqObj.Open ReqMet, "http://getmyarticles.com/engine.php?" & HTTPQuery & PostStr, False
If ReqMet = "POST" Then
HttpReqObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
End If
HttpReqObj.Send
If HttpReqObj.Status <> 200 Then
Er = "Error: Status=" & HttpReqObj.Status & " Text=" & HttpReqObj.ResponseText
GetMyArticlesData = False
Else
Resp = HttpReqObj.responseText
GetMyArticlesData = True
End If
End If
End Function
If GetMyArticlesData(GMAQ, GMAS, GMAResult, GMAError, ReqType) Then
If Action = "rss" Then
Response.ContentType = "application/xml"
End If
Response.Write GMAResult
Else
' here we are just dumping error info to the page. You can clean this up to
' fit your site
Response.Write GMAError
End If
' # //FINSIHED GetMyArticles.com SCRIPT BLOCK
%>
|