|
In order to automate your syndication, you must be able to write queries against your database and create executable scripts on your website.
There are 3 steps to creating an automated feed:
- Determine the correct "Connection String" for your database.
- Create a query to retrieve the listings from your database
- Write the listings to a web page in XML format.
Step 1 - Determine the Correct Connection String.
There are many different databases as well as versions and setup configurations to go along with them. Some of the most commonly used strings are below. Please check with your web administrator if you are not sure which one in appropriate for you.
ConnectionStrings.com is also an excellent resource to check if the ones below do not work for you.
|
Database |
|
MySQL |
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; |
|
SQL Server 2008 |
Data Source=myServerAddress;Initial Catalog=myDataBase;User
Id=myUsername;Password=myPassword; |
|
SQL Server 2005 |
Data Source=myServerAddress;Initial Catalog=myDataBase;User
Id=myUsername;Password=myPassword; |
|
SQL Server 2000 |
Data Source=myServerAddress;Initial Catalog=myDataBase;User
Id=myUsername;Password=myPassword; |
|
MS Access 2007 |
Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False; |
|
MS Access (Other) |
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User
Id=admin;Password=; |
|
All Others |
Please see ConnectionStrings.com |
Step 2 - Create a Database Query
The sample scripts are designed to create the xml based upon the field names identified in the query. It is VERY IMPORTANT that your fields are mapped correctly, otherwise
your feed may fail. Propper mapping is accomplished by using alliases in your query. For example
. . .
"Select PropertyID AS ListingID, FirstName + ' ' + LastName as AgentName, ...."
will output the field PropertyID as "ListingID", and the first and last names combined to form "AgentName". Be sure to use any Casts, Converts, table joins, etc that will format your data
to conforms with our
Feed Technical Specs.
Below is an example of a SQL Server query(with 2 joined tables) that you can use as a starting point for creating your own.
Please don't forget to include a "WHERE clause" in your query to filter out any listings that are no longer for sale or should not be syndicated!
View Sample Query
Step 3 - Choose and Modify your Script.
Below are scripts for common web platforms. You web platform can be identified by the extension found in the URL Address of your web pages". Select the script that best fits your situation.
| Types of Web Pages |
.PHP
|
Pearl |
|
.ASP
|
Active Server Page |
Also called "Classic ASP" |
| .ASPX |
.NET (ie "Dot Net") |
Replacment for ASP. Can be coded in VB or C# |
| JSP |
Java Server Pages |
|
| CFM |
Cold Fusion |
|
| .HTM or .HTML |
Basic HTML |
Unlike the others, html is not a "Server Side Technology" and is designed for displaying "Static Content" that does not change. Check to see if your pages are already being hosted on one of the other technologies. |
|