Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 General help me questions
 Strip HTML For Froogle
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

bmw000
VP-CART New User

137 Posts

Posted - May 13 2004 :  20:35:59  Show Profile  Visit bmw000's Homepage  Reply with Quote
My descriptions have html tags for display and formatting on my website.

Froogle does not allow html code, new line carraige returns and page breaks.

I would like to utilize an empty column in the products table and have a plain text version of my descriptions.

How can I go about stipping all of the html, page breaks and new line carraige returns?

Basically it has to be a one line plain text version of my description.

I am using vpasp version 5 and microsoft sql server 2000.

Does anyone have any ideas?

I am aware of the froogle feed program from samburu. After speaking with them, they currently only strip out <br> tags, tabs, and newlines. Not html code which has discourged me from purchasing it.

I connected directly to my products table via access 2000 and was able to create a query to generate everything needed for the froogle feed except for the html, carraige returns and page breaks.

Thanks In Advance,
Brian Weber

jonmadrid
VP-CART New User

USA
192 Posts

Posted - May 13 2004 :  22:09:01  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
Hi Brian,

Here's a function that will strip out any HTML in a string thats passed to it:

*******
Function StripHTML(strString)
While InStr(strString, "<") > 0
strString = Mid(strString, 1, InStr(strString, "<") - 1) & Mid(strString, InStr(strString, ">") + 1, Len(strString) - InStr(strString, ">") + 1)
Wend
StripHTML = strString
End Function
*******

A word of caution: this assumes that anything between a < and a > is an HTML tag and will subsequently just wipe it out. This could be a problem if you have either of those characters (< or >)in your fields for use other than as HTML tag delimeters. Otherwise, this little snippet of code will do just the trick for stripping out HTML.

I would put it in the shop$db.asp file so that it can be called from any page in the cart. Then, wherever you need to filter out HTML from a string just do something like this:

*******
myString = StripHTML(myString)
*******

That just calls the function, does the work, and assigns the new string value to the variable. Easy as that.

If you still don't know what to do with this bit of code though, let me know where you need to use it (file, purpose, etc) and I can try to give you more detailed instructions on what to do with it.

Hope that helps!

All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - May 14 2004 :  04:34:27  Show Profile  Visit bmw000's Homepage  Reply with Quote
Jon,

That works great for deleting the html code. Thanks!!

I added that function to my access project and called it from there becuase that is where I am querying the data to create my feed.

What about deleting carraige returns and replacing them with a space?

How does sql server recognize carraige returns so they can be replaced by a space?

Thanks

Brian Weber

Go to Top of Page

jonmadrid
VP-CART New User

USA
192 Posts

Posted - May 14 2004 :  11:16:48  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
Hi Brian,

You could do something you like this:

*******
myString = Replace(myString,VBCrLf," ")
*******

That looks for VBCrLF (which is a VB line return) and replaces it with a space.

That should do what you need it to do.

All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - May 14 2004 :  17:12:51  Show Profile  Visit bmw000's Homepage  Reply with Quote
Jon,

Apparently access seems to choke when saving the data because access see the fields as memo fields.

How can this code be used to read the extendeddesc field strip the html out and then insert it into the pother1 field from an asp page?

I don't much about asp. So I put the code above in shop$db.asp file. Does it matter where I put it? Can I just put it at the end? Then what can be used to call this function strip the html and update the stipped html to the pother1 field? If this is possible, then say if I run it again after adding new products in the future or if i have to change some descriptions, will the update replace whats in the existing fields or add it to the end of the text in the field? I need the ability to update it if something changes.

I can then strip out the tabs chr(11), carraige returns chr(13) and line feeds chr(10) in ms access. The replace funtion seems to work ok for these characters in ms access.

Thanks,
Brian Weber

Go to Top of Page

Jill
VP-CART Super User

USA
249 Posts

Posted - May 14 2004 :  18:50:00  Show Profile  Reply with Quote
Brian,

Could you just copy the extended desc field contents over to pother1, and strip the html from there?

Jill

Go to Top of Page

jonmadrid
VP-CART New User

USA
192 Posts

Posted - May 14 2004 :  18:52:28  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
Hi Brian,

You got me a little confused there. What exactly do you need this for -- when adding a product?

As a note about the Replace() function, it can be used anywhere, anytime in an ASP page since it is a built-in function of VBScript. There is no need to place it in the shop$db.asp file in order to be called when it comes to the shopping cart.

Another possibility would be to write a function that in turn calls the replace function if you always wanted to replace the same things. Always replacing line feeds with spaces, for example. Any string you passed to that function would automatically have those values switched out. Just do something like this:

*******
Function DoReplace(str)

DoReplace = Replace(str,"what_to_look_for","what_to_replace_it_with")

End Function
*******

Again, if you let me know exactly what you need this for I may be able to be of better assistance.

All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - May 14 2004 :  19:38:16  Show Profile  Visit bmw000's Homepage  Reply with Quote
I already have the products added so this task will need to be done after they are added.

I don't know how much better I can explain this, so here goes.

I would like to be able take the data in the description field and copy it to another empty field. My description field in the database is called extendeddesc and the field I want to copy it to is pother1.

I guess it have to work like this. Take the data from the extendeddesc field, strip the html and other characters listed below and then put it in the empty pother1 field. Then I will have both an html formatted version in the extendeddesc field for use on my website and a non html formatted version in the pother1 field for use with my froogle feed.

The reason I need to do this is because I am going to be creating a data feed to upload to froogle and they do not allow html tags. They also do not allow tabs chr(11), carriage returns chr(13) and line feeds chr(10) which would also need to stripped.

Brian Weber

Go to Top of Page

ProductivePC
VP-CART New User

USA
199 Posts

Posted - May 16 2004 :  19:50:43  Show Profile  Visit ProductivePC's Homepage  Reply with Quote


I think I see a new addon coming for the next cart guys.... A Froogle Friendly Data Feed Sheet.

Brian, I have been following along and I too am interested in finding an easy way to make froogle feeds. I have found the froogle feeder software but that requires you to enter every product in manually with the price and description, etc etc etc.

When you get this working can you please e-mail me at:
webmaster at SpectacularStuff.com.

Thanks




Wayne
www.WorldFamousGiftBaskets.net
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - May 17 2004 :  04:43:40  Show Profile  Visit devshb's Homepage  Reply with Quote
The samburu froogle-feed (now "bigyellowzone.com" froogle-feed) deals with all this stuff, automatically replacing newlines/returns/<br>'s/tabs with spaces and also does various other translations to make the feed fit in with froogle's rules.

It also formats your category tree properly/automatically in the file.

It also allows you to easily switch your product name/description derivation to different columns or combinations of columns.

The only thing it doesn't do (yet) is to strip-out html tags and characters that haven't been explicitly mentioned by froogle's rules (eg <b>, <td> etc), but that can easily be added as an extra config option and we'd be happy to do that.

>>amendment; this has now been added to the feed.

The feed also has a demo version available so you can try it online through the demo site and hence see all the options and how simple it is to use/install; this'll be publicly available very soon.

If anyone wants the froogle feed, you can get it from:

http://bigyellowzone.com/shopdisplayproducts.asp?product=froogle

In the meantime, any extra comments about what people would like as part of a froogle-feed are more than welcome.

The feed does a massive amount of stuff for you; it's not just a blanket product export, so in my view it's well worth the small outlay. You can't get much more simple than just pressing a [continue] button to generate a full feed file, so it gets my vote!

Simon Barnaby
Freelance Developer
Java-E UK
[email protected]

Edited by - devshb on August 20 2004 13:29:23
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - May 17 2004 :  20:19:49  Show Profile  Visit bmw000's Homepage  Reply with Quote
I purchased the froogle feed generator from Simon through samburu.com.

This is one nice product. It is easy to configure and install. It only took about 5 min to get it up and running.

It makes the froogle feed directly within the vpasp admin menu.

It generates the file formatted per froogles specs. My feed had 611 products and took a matter of seconds for the file to be created.

I uploaded my first froogle feed today!

Thanks,
Brian Weber

Go to Top of Page

ProductivePC
VP-CART New User

USA
199 Posts

Posted - May 17 2004 :  21:02:35  Show Profile  Visit ProductivePC's Homepage  Reply with Quote
Brian, One big question. Froogle requires a valid URL where each individual product is at.... When the URL is generated dynamically it will be invalid.... How is everyone getting around this? Are you using the HTML generated pages? How does the froogle feeder get around this?

Wayne
www.WorldFamousGiftBaskets.net
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - May 18 2004 :  02:44:15  Show Profile  Visit devshb's Homepage  Reply with Quote
The froogle feeder uses shopexd.asp with the corresponding arguments, an each portion of the url is configurable, it's in the format:

yourshoppingsiteurl/yourproductdetailspage?yourargument=yourproductid

yourshoppingsiteurl defaults to the vpasp xmysite config value
yourproductdetailspage defaults to "shopexd.asp"
yourargument defaults to "id"
yourproductid defaults to the product catalogid

so, your url will default to something like:
http://www.yoursite.com/shopexd.asp?id=100

but all 4 of those bits are configurable and can be changed to anything you want. likewise you can also specify your image locations.

Simon Barnaby
Freelance Developer
Java-E UK
[email protected]
Go to Top of Page

revrat
Starting Member

47 Posts

Posted - May 21 2004 :  12:49:46  Show Profile  Reply with Quote
My feed keeps getting rejected from froogle and I use the SAMBRU product.

I sell CD's and records and the descriptions are quite long. I made my description field be the same as my item field so both will read

Rolling stones - Stick Fingers - CD
(I removed the duplicate entries from all displays.)

Froogle rejects this and says I need to use the Extended Description Info. Many of which are HTML and also need to be truncated. An auto truncate and HTML removal would be great.

But how do I make the product get the descritpion from the Extended description instead of the Regular Description

Thanks

Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - May 21 2004 :  13:55:15  Show Profile  Visit devshb's Homepage  Reply with Quote
hi revrat,

if you email me from the same email account that you used to buy the feed with, i'll send you an update and explain how to change the field derivations; i'm unsure which version you've got, but the brand-new one that we're about to release has got lots of extra bits in it which'll do everything you need (including the html-stripping), and that's the one i'd be sending you.

if anyone else has any problems/questions with their samburu feed, please feel free to email me anytime.

we'll soon be sending out updates to everyone who's bought the feed so that everyone'll have the nice new fresh version with all the extra functions, so just let me know if you've already bought it and want a new version in advance of the general release.

Simon Barnaby
Freelance Developer
Java-E UK
[email protected]

Edited by - devshb on May 21 2004 13:56:32
Go to Top of Page

devshb
Senior Member

United Kingdom
1904 Posts

Posted - May 21 2004 :  16:37:59  Show Profile  Visit devshb's Homepage  Reply with Quote
You can now try our Froogle-Feed online in our demo area without any need to purchase or register etc; this'll give you an idea of the options that you can use and how it works.

Just go to:
http://bigyellowzone.com/shopdisplayproducts.asp?product=froogle

and click on [more] for your version, and from there you'll see the demo link.


Our new site that's selling addons has just this minute gone live, so you can view our stuff on:

http://bigyellowzone.com/

there's a forum on there too for hints/tips/help etc, so feel free to post away!

If you like that, you also might like our panel-splitter for vpasp which also has demo versions available:

http://bigyellowzone.com/shopexd.asp?id=26

or our packingslip:

http://bigyellowzone.com/shopexd.asp?id=18

All these addons are updated/enhanced versions of the samburu ones (samburu and bigyellowzone are owned by the same people) - we'll be re-pointing the samburu links asap to point to the new site, so if you want the latest version with all the extra bits, go to:

http://bigyellowzone.com/

Simon Barnaby
Freelance Developer
Java-E UK
[email protected]

Edited by - devshb on August 16 2004 18:23:29

Edited by - devshb on August 20 2004 13:31:48
Go to Top of Page
Page: of 2
Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00