Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Changing a script from coldfusion
Old 09-13-2004, 11:25 PM Changing a script from coldfusion
sirpaul's Avatar
Average Talker

Posts: 25
Trades: 0
This is an old script from last season and last server to put the standings on my site. Our new server doesn't support coldfusion so I was wondering if anyone could help me out. Can this be altered and done in java or something else? It mainly rips info off of one site when asked and puts it on my site how we have it set up. Here is the old script.

<cfhttp method="get" url="http://sports.yahoo.com/nba/standings" resolveurl="no">

<!--- moving to the central division --->
<cfset start = find("Central", cfhttp.FileContent)>

<!--- grabbing the team row --->
<cfset row_start1 = find("<tr class=""ysprow", cfhttp.FileContent, start)>
<cfset start1 = find("<td", cfhttp.FileContent, row_start1)>
<cfset end1 = find("</tr>", cfhttp.FileContent, start1)>
<cfset team1 = mid(cfhttp.FileContent, start1, end1 - start1)>

<!--- removing the team url --->
<cfset url_start1 = find("<a", team1)>
<cfset team1 = removechars(team1, url_start1, 25)>
<cfset url_end1 = find("</a>", team1)>
<cfset team1 = removechars(team1, url_end1, 4)>

<!--- grabbing the team row --->
<cfset row_start2 = find("<tr class=""ysprow", cfhttp.FileContent, end1)>
<cfset start2 = find("<td", cfhttp.FileContent, row_start2)>
<cfset end2 = find("</tr>", cfhttp.FileContent, start2)>
<cfset team2 = mid(cfhttp.FileContent, start2, end2 - start2)>

<!--- removing the team url --->
<cfset url_start2 = find("<a", team2)>
<cfset team2 = removechars(team2, url_start2, 25)>
<cfset url_end2 = find("</a>", team2)>
<cfset team2 = removechars(team2, url_end2, 4)>

<!--- grabbing the team row --->
<cfset row_start3 = find("<tr class=""ysprow", cfhttp.FileContent, end2)>
<cfset start3 = find("<td", cfhttp.FileContent, row_start3)>
<cfset end3 = find("</tr>", cfhttp.FileContent, start3)>
<cfset team3 = mid(cfhttp.FileContent, start3, end3 - start3)>

<!--- removing the team url --->
<cfset url_start3 = find("<a", team3)>
<cfset team3 = removechars(team3, url_start3, 25)>
<cfset url_end3 = find("</a>", team3)>
<cfset team3 = removechars(team3, url_end3, 4)>

<!--- grabbing the team row --->
<cfset row_start4 = find("<tr class=""ysprow", cfhttp.FileContent, end3)>
<cfset start4 = find("<td", cfhttp.FileContent, row_start4)>
<cfset end4 = find("</tr>", cfhttp.FileContent, start4)>
<cfset team4 = mid(cfhttp.FileContent, start4, end4 - start4)>

<!--- removing the team url --->
<cfset url_start4 = find("<a", team4)>
<cfset team4 = removechars(team4, url_start4, 25)>
<cfset url_end4 = find("</a>", team4)>
<cfset team4 = removechars(team4, url_end4, 4)>

<!--- grabbing the team row --->
<cfset row_start5 = find("<tr class=""ysprow", cfhttp.FileContent, end4)>
<cfset start5 = find("<td", cfhttp.FileContent, row_start5)>
<cfset end5 = find("</tr>", cfhttp.FileContent, start5)>
<cfset team5 = mid(cfhttp.FileContent, start5, end5 - start5)>

<!--- removing the team url --->
<cfset url_start5 = find("<a", team5)>
<cfset team5 = removechars(team5, url_start5, 25)>
<cfset url_end5 = find("</a>", team5)>
<cfset team5 = removechars(team5, url_end5, 4)>

<!--- grabbing the team row --->
<cfset row_start6 = find("<tr class=""ysprow", cfhttp.FileContent, end5)>
<cfset start6 = find("<td", cfhttp.FileContent, row_start6)>
<cfset end6 = find("</tr>", cfhttp.FileContent, start6)>
<cfset team6 = mid(cfhttp.FileContent, start6, end6 - start6)>

<!--- removing the team url --->
<cfset url_start6 = find("<a", team6)>
<cfset team6 = removechars(team6, url_start6, 25)>
<cfset url_end6 = find("</a>", team6)>
<cfset team6 = removechars(team6, url_end6, 4)>

<!--- grabbing the team row --->
<cfset row_start7 = find("<tr class=""ysprow", cfhttp.FileContent, end6)>
<cfset start7 = find("<td", cfhttp.FileContent, row_start7)>
<cfset end7 = find("</tr>", cfhttp.FileContent, start7)>
<cfset team7 = mid(cfhttp.FileContent, start7, end7 - start7)>

<!--- removing the team url --->
<cfset url_start7 = find("<a", team7)>
<cfset team7 = removechars(team7, url_start7, 25)>
<cfset url_end7 = find("</a>", team7)>
<cfset team7 = removechars(team7, url_end7, 4)>

<!--- grabbing the team row --->
<cfset row_start8 = find("<tr class=""ysprow", cfhttp.FileContent, end7)>
<cfset start8 = find("<td", cfhttp.FileContent, row_start8)>
<cfset end8 = find("</tr>", cfhttp.FileContent, start8)>
<cfset team8 = mid(cfhttp.FileContent, start8, end8 - start8)>

<!--- removing the team url --->
<cfset url_start8 = find("<a", team8)>
<cfset team8 = removechars(team8, url_start8, 25)>
<cfset url_end8 = find("</a>", team8)>
<cfset team8 = removechars(team8, url_end8, 4)>

<cfset output=
"
<table cellpadding=""3"" cellspacing=""3"" border=""0"">
<tr>
<td>Central</td>
<td>W</td>
<td>L</td>
<td>Pct</td>
<td>GB</td>
<td>Home</td>
<td>Road</td>
<td>Div</td>
<td>Conf</td>
<td>Streak</td>
<td>L10</td>
</tr>


<tr>#team1#</tr>
<tr>#team2#</tr>
<tr>#team3#</tr>
<tr>#team4#</tr>
<tr>#team5#</tr>
<tr>#team6#</tr>
<tr>#team7#</tr>
<tr>#team8#</tr>
<tr>
<td colspan=""11"">
<strong>x-</strong>Clinched Playoff Spot; <strong>y-</strong>Division Champ; <strong>z-</strong>Conference Champ
</td>
</tr>
</table>
">

<cfset thisPath = ExpandPath("*.*")>
<cfset thisDirectory = GetDirectoryFromPath(thisPath)>
<cffile action="write" file="#thisDirectory#/test.cfm" output="#output#">

<a href="test.cfm">STANDINGS UPDATED!</a>
sirpaul is offline
Reply With Quote
View Public Profile Visit sirpaul's homepage!
 
 
Register now for full access!
Reply     « Reply to Changing a script from coldfusion
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24097 seconds with 12 queries