Text box displays

Help each other out

Text box displays

Postby slaman on Wed May 16, 2007 12:12 am

A couple of questions when displaying text...

1) In a database XML, you have to separate entries using the '/' delimiter. For example:

<actors>Tom Cruise/Halle Berry</actors>

That would show up in the database as two separate actor entries... however, when I print this field using:

category>movies>actors

It shows up as: "Tom Cruise/Halle Berry"

which is ugly... any ideas to display each entry separated by another delimiter? Perhaps ', ' instead or even '/n'

2) How do I display static text alongside a database field. For example, I want to display "Page category>music>search>page" where the end result would be "Page 4of11"

Any ideas?

3) tswhite - in your spiders, it grabs actors and separates them using ',' - anyway to separate them using '/' so the system recognizes individual entries?

Thanks for the help!
slaman
 
Posts: 145
Joined: Sat Oct 14, 2006 10:30 pm

Postby tswhite70 on Wed May 16, 2007 4:28 pm

Slaman - I'll try and answer...

1) Not sure what you mean by "a database XML", are you speaking to conventional database XML representation? In Xlobby the "/" is just text inside the <actors> field like anything else so when you display the field it will show with the slashes. The only time it represents something different is when filtering where it splits the "items" in the field for filter selection based on the slash (ie the Genre field). As far as I know that's how things work.

How are you getting your actor information? what spider? If it's coming from a spider that way then it's probably how it's listed on the website - if that's true then the spider may be able to be rewritten using the Variable method to put commas in place of the slashes. (fwiw all my actors are separated by commas, and I populate the field either with the IMDB spider or the Amazon spider).

2) Text would be: Page %music>search>page% of %music>search>totalpages%
There is no music>search category that I'm aware of so you would probably need %filterdetails>page% instead, but you get the idea - the % signs allow you to include other text...

3) No, the introduction of the comma is internal Xlobby code based on the spider Variable functionality. I *would* like to be able to specify the divider character in the spider (see here). And be able to perform a regex search in replace on any field within the spider (see here).

EDIT: #3 Just noticed you were the one I responded to before about the variable/item delimiter question in the post I linked... did I not explain it well? Is there a particular spider that's giving you results you don't like, maybe we could modify it?

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby slaman on Wed May 16, 2007 7:01 pm

Thanks tswhite! I am using your spider to grab information from IMDB. You did explain it perfectly the first time I asked, so I'm not sure why I asked again :P

The reason is... now I can't filter based on the actors items since they are separated by commas...

So I have to manually change the commas to slashes upon import so that I can filter on them... but that looks visually ugly when I display it.

I guess I have to decide between visually appealing and filter capabilities.

Unless you see another way around this?
slaman
 
Posts: 145
Joined: Sat Oct 14, 2006 10:30 pm

Postby tswhite70 on Wed May 16, 2007 9:49 pm

Gotcha - There's no "built-in" way around the issue right now that I know of. The only option to have it perform the way you want is to create a second actors field, call it "filteractors" and put the actors in that field with slashes. Then filter on that field instead of the traditional "actors" field. This would of course be a manual process, although you could write a little script to do it for all your movies in the db the first time. I've implemented this idea in a couple databases, the AppleMovieTrailers utility does this for theaters & showtimes right now. I also add a field for all my movies called filterrating for more or less the same purpose. It would be nice if Xlobby provided a mechanism to "modify" the view properties of a field based on delimeters for display, or better yet allow you to specify a delimeter for filtering on.

If the spiders allowed you specify a delimiter then you could just spider for actors twice, once with a comma and once with a slash. But it would be nice not to have to duplicate data to get the functionality.

Maybe somebody else has a better solution...anyone?

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby slaman on Thu May 17, 2007 2:04 pm

That's an interesting way of doing it... I may consider that... but, at the moment, I don't have actor information for about 150 movies... and it'll be a pain to spider them all in one day.

Also, your spider for imdb doesn't grab director information - try spidering "apocalypt" (without the 'o', since putting the 'o' returns a bunch of weird hyperlink stuff)
slaman
 
Posts: 145
Joined: Sat Oct 14, 2006 10:30 pm

Postby tswhite70 on Thu May 17, 2007 5:01 pm

Looks like IMDB changed their heading(s) again. I'll update the spider sometime this weekend, probably need to take a look at all of them to make sure they are still getting the right info.

If you want to fix yours sooner - go to Xlobby\spiders and open dvd - imdb.com.txt in notepad. The following line:
<h5>Directed by</h5>(?<variable>.*?)<br/>
Should now be:
<h5>Director:</h5>(?<variable>.*?)<br/>

Make sure you don't leave any trailing spaces on the line if you cut and paste.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby slaman on Thu May 17, 2007 7:58 pm

Thanks tswhite! I think I understand the spiders well enough now to make the modifications when the headers change now.
slaman
 
Posts: 145
Joined: Sat Oct 14, 2006 10:30 pm