<html>
<head>
<script language="javascript">
document.domain="construction.com";
</script>
<script type="text/javascript" src="http://sitelife.construction.com/ver1.0/Direct/DirectProxy"></script>
</head>
<body>
<script language="javascript">
document.domain="construction.com";
</script>
<script type="text/javascript" src="http://sitelife.construction.com/ver1.0/Direct/DirectProxy"></script>
</head>
<body>
<script language="JavaScript">
var requestBatch = new RequestBatch();
var serverUrl = "http://sitelife.construction.com/ver1.0/Direct/Process";
var searchType = "BlogPost"; // others are Comment, ForumPost, Gallery, Photo, Video
// var searchString = "Title:Pennsylvania"; // To search only the title for Penn
var searchString = "Pennsylvania";
requestBatch.AddToRequest(new SearchAction(searchType, searchString, 10, 1));
requestBatch.BeginRequest(serverUrl, clientCallBack);
function clientCallBack(responseBatch) {
// console.dir(responseBatch); // -- use this in Firefox (only) to show the responseBatch object in the console to see what data is available.
var searchResults = responseBatch.Responses[0].SearchResult.SearchResults;
var htmlString = "<h2>" + searchType + " Search Results " + "for " + searchString + ":</h2><br>";
if (searchType == "BlogPost") // only showing an example of BlogPost for now
{
for (var i = 0; i < searchResults.length; i++)
htmlString += "<a href=\"" + searchResults[i].Url + "\">" + searchResults[i].PostTitle + "</a> by: <a href=\"" + searchResults[i].PostAuthor.PersonaUrl + "\">" + searchResults[i].PostAuthor.DisplayName + "</a> on " + searchResults[i].PostDate + "<br>";
}
document.getElementById("output_div").innerHTML = htmlString;
}
</script>
<div id="output_div"></div>
<script language="JavaScript">
var requestBatch = new RequestBatch();
var serverUrl = "http://sitelife.construction.com/ver1.0/Direct/Process";
var searchType = "ForumPost"; // others are Comment, ForumPost, Gallery, Photo, Video
// var searchString = "Title:Pennsylvania"; // To search only the title for Penn
var searchString = "Pennsylvania";
requestBatch.AddToRequest(new SearchAction(searchType, searchString, 10, 1));
requestBatch.BeginRequest(serverUrl, clientCallBack);
function clientCallBack(responseBatch) {
// console.dir(responseBatch); // -- use this in Firefox (only) to show the responseBatch object in the console to see what data is available.
var searchResults2 = responseBatch.Responses[0].SearchResult.SearchResults;
var htmlString2 = "<h2>" + searchType + " Search Results " + "for " + searchString + ":</h2><br>";
if (searchType == "ForumPost") // only showing an example of BlogPost for now
{
for (var i = 0; i < 10; i++)
htmlString2 += "<a href=\"" + searchResults2[i].PostUrl + "\">" + searchResults2[i].PostTitle + "</a> by: <a href=\"" + searchResults2[i].LiteUser.PersonaUrl + "\">" + searchResults2[i].LiteUser.DisplayName + "</a> on " + searchResults2[i].LastUpdated + "<br>";
}
document.getElementById("output_div2").innerHTML = htmlString2;
}
</script>
<div id="output_div2"></div>
</body>
</html>
|