360385 Sitemap from flatfile db

Concluído Postado Oct 20, 2009 Pago na entrega
Concluído Pago na entrega

Hi, thanks for looking at my project. I need a PHP script which will read a tab-delineated text flatfile and generate an XML sitemap, formatted for Google Video. All needed specifications are included here.

The source database is a text file, in which records are separated by a carriage return and fields are separated by tabs.

Here is the guide to the fields:

[url removed, login to view]

This is what we need the result file to look like (## numbers below correspond to the field number of the source record ... so for example, ##2## would be the text from field 2 of the record):

<urlset xmlns="[url removed, login to view]"

xmlns:video="[url removed, login to view]">

<url>

<loc>http://www.autopages.com/videolistings/##9##.html</loc>

<video:video>

<video:content_loc>http://www.autopages.com/mp4/##9##.mp4</video:content_loc>

<video:thumbnail_loc>[url removed, login to view]**see note**</video:thumbnail_loc>

<video:title>##2## ##3## ##4## in ##8##, ##15##</video:title>

<video:description>For more info on this vehicle, call us at ##7##.

See the full listing at [url removed, login to view] ##5##. $##6##.</video:description>

<video:tag>##3##</video:tag>

<video:tag>##4##</video:tag>

<video:tag>##8##</video:tag>

<video:category>Autos for Sale</video:category>

<video:family_friendly>yes</video:family_friendly>

<video:duration>60</video:duration>

</video:video>

</url>

</urlset>

So, here is an example source record:

v 2008 Jeep Wrangler X 4x4 Loaded with options. Ask for ford used sales when you call. we have been in business since 1938. great financing rates available! Power door locks, power windows, alloy wheels, cruise control, rear defroster, console, cd player, am/fm radio, bucket seats, cloth seats, warranty, a/c. Stop by before it's gone. 24941 1-800-784-1334 Tacoma twf_W5805 F W5805 TWF Titus Will Ford 3606 S Sprague Avenue WA 98409 [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] 83149 [url removed, login to view]

And that record would look like this in the destination XML file:

<urlset xmlns="[url removed, login to view]"

xmlns:video="[url removed, login to view]">

<url>

<loc>http://www.autopages.com/videolistings/twf_W5805.html</loc>

<video:video>

<video:content_loc>http://www.autopages.com/mp4/twf_W5805.mp4</video:content_loc>

<video:thumbnail_loc>http://www.autopages.com/listingthumbnails/04326449_001.jpg</video:thumbnail_loc>

<video:title>2008 Jeep Wrangler X in Tacoma, WA</video:title>

<video:description>For more info on this vehicle, call us at 1-800-784-1334.

See the full listing at [url removed, login to view] Loaded with options. Ask for ford used sales when you call. we have been in business since 1938. great financing rates available! Power door locks, power windows, alloy wheels, cruise control, rear defroster, console, cd player, am/fm radio, bucket seats, cloth seats, warranty, a/c. Stop by before it's gone. $24,941.</video:description>

<video:tag>Jeep</video:tag>

<video:tag>Wrangler X</video:tag>

<video:tag>Tacoma</video:tag>

<video:category>Autos for Sale</video:category>

<video:family_friendly>yes</video:family_friendly>

<video:duration>60</video:duration>

</video:video>

</url>

</urlset>

Beyond this simple mapping, there are only a few added functions the script needs to have:

1.) It should skip all records in the source database which do not have "F" in field 10.

2.) The script should have an "exclude" array in its settings area. (i.e., "$exclude = array("ASF","CPK","KOR","BTT","BTA","BTN","RTH","RLP","RLC","RLV","AAP","GIL","LMM","AOT","PSU");"

Any record whose field 12 contains one of the values in this array should be skipped.

3.) For the "<video:thumbnail_loc>" value, the script should write "[url removed, login to view]" followed by the FILENAME of the URL in record field 18. In other words, if record field 18 contains, for example: "[url removed, login to view]", the script should replace the URL with the one [url removed, login to view] on above and append the filename ([url removed, login to view]) to it.

So, as you can see above, the resulting line should be:

<video:thumbnail_loc>http://www.autopages.com/listingthumbnails/04326449_001.jpg</video:thumbnail_loc>

The result XML file created by this script will be checked for validation.

That's it! Please let me know if you have any questions and I look forward to working with you.

Odd Jobs PHP

ID do Projeto: #2106219

Sobre o projeto

1 proposta Projeto remoto Ativo em Jul 11, 2012

Concedido a:

zonvra

hi, i can do this job immediately.

$55 USD em 0 dias
(0 Comentários)
0.0