473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

coding fun

Hi i am new to javascript, done a bit C coding for school assignment.

I trying to crate a page that search google, then collect all the ads,
therefore no search results. Last display display the ads in some
random layout format?

Anyone have tips how this could be done?

Jul 15 '06 #1
3 1262
Anyone have tips how this could be done?

It can't. For security reasons you can't read from a page outside your
own domain. You'll need to add some server-side scripting to make that
work. You could for example, execute the search from your own PHP
script, and output the results in your own domain, but then again, if
you do that, you can just as well make the whole thing PHP. You can also
install tools like Grease Monkey (http://greasemonkey.mozdev.org/) with
firefox to run scripts on a page, and do something with it.

Vincent
Jul 15 '06 #2
I have my own server set up! So if i have server its possible to write
in PHP/JS such a thing?
Vincent van Beveren wrote:
Anyone have tips how this could be done?

It can't. For security reasons you can't read from a page outside your
own domain. You'll need to add some server-side scripting to make that
work. You could for example, execute the search from your own PHP
script, and output the results in your own domain, but then again, if
you do that, you can just as well make the whole thing PHP. You can also
install tools like Grease Monkey (http://greasemonkey.mozdev.org/) with
firefox to run scripts on a page, and do something with it.

Vincent
Jul 15 '06 #3
Owning schreef:
I have my own server set up! So if i have server its possible to write
in PHP/JS such a thing?
Yes. However, it'll take some work. First in PHP you'll have to make the
call to google, and redirect the output into a string, or into a page in
your own domain. You'll basically have two options:

1. Use PHP as no more than a transfer of the webpage.
2. Let PHP do the processing.

In the first case you'll execute a HTTP request through PHP and just
take the output from that and output it on your own page. You could let
PHP then append a JavaScript to that output, effectivly making a
combined page of your JavaScript and Googles output.

In the second case you'll executre a HTTP request throuhg PHP and
capture the output in a String. You can then process the page in PHP and
extract the information you want. After that you'll only output the
results to your browser.

The second one is more reliable. However, depending on what your goal is
with this you might just as well do the first.

Have fun,
Vincent

Jul 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dotNetDave | last post by:
About three weeks ago I released the first .NET coding standards book titled "VSDN Tips & Tricks .NET Coding Standards". Here is what the famous author/ speaker Deborah Kurata says about it: ...
144
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this...
7
by: Ralph Lund | last post by:
Hi. I am starting a new project with C#. I am searching for "good" coding conventions. I know that there are some coding conventions from microsoft, (but they are very extensive and not clear)....
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
3
by: editormt | last post by:
A recent poll asked if programming standards are used by development organisations... and if they are controlled. None: 20% Yes, but without control: 49% Yes, with control: 31% Participants:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.