Results 1 to 8 of 8
  1. #1
    ABW Ambassador Steveinid's Avatar
    Join Date
    January 18th, 2005
    Posts
    827
    Don't know if there is a PHP answer for this.

    I want to use the Ebay snippets on my site but also want to benefit from the keywords they have on them. However, they are in Javascript. Viewing the "source" shows the script and not the actual words shown by the browser. Is there anyway to get the server to interperet the javascript before it sends it to the browser? I tried saving the script as a seperate file and then using an include but that didn't work.

    Any suggestions?

    Thanks
    Steve

    "Bueller...? Bueller...?"

  2. #2
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    As far as I know, Javascript is only interpreted by the browser. I don't think I've heard of a PHP class that parses Javascript. It just doesn't seem possible considering javascript is user-event-driven which means most javascript events won't happen on the server level.

  3. #3
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    Are the words in the javascript? Maybe they can be parsed using a regular expression?

    ------------------------------
    "A man is but the product of his thoughts. What he thinks, he becomes." -- Mahatma Gandhi

  4. #4
    ABW Ambassador Steveinid's Avatar
    Join Date
    January 18th, 2005
    Posts
    827
    No. The words are not. It is similar to google adsense. Just a few lines of code and it will deliver alot of content. I was hoping to take advantage of that content.

    Thanks
    Steve

    "Bueller...? Bueller...?"

  5. #5
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    You might want to try to open the url containing the javascript via an fopen() call then parse the resulting HTML. Might be difficult though.

  6. #6
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    Just took a look at how Google Adsense works which is kind of neat in a totally geeky sort of way. Also flawed but I'm not going there.

    ------------------------------
    "A man is but the product of his thoughts. What he thinks, he becomes." -- Mahatma Gandhi

  7. #7
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Snib:
    You might want to try to open the url containing the javascript via an fopen() call then parse the resulting HTML. Might be difficult though.<HR></BLOCKQUOTE>Don't bother won't work. The show_ad.js just creates another URL and writes that to the document. That's the URL you need.

    [Edit - That's if Ebay works like Google.]
    ------------------------------
    "A man is but the product of his thoughts. What he thinks, he becomes." -- Mahatma Gandhi

    [This message was edited by Buddha on January 08, 2004 at 09:04 PM.]

  8. #8
    ABW Ambassador Steveinid's Avatar
    Join Date
    January 18th, 2005
    Posts
    827
    Thanks again for your help. Someday I'll know all this stuff.

    Steve

    "Bueller...? Bueller...?"

  9. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. PHP question - include(file.php) with variables
    By teezone in forum Programming / Datafeeds / Tools
    Replies: 8
    Last Post: September 4th, 2009, 04:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •