×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Finding an easter-egg in Internet with Visual Foxpro
2

Finding an easter-egg in Internet with Visual Foxpro

Finding an easter-egg in Internet with Visual Foxpro

(OP)
If I want to search for a term in Google - it's easy:
I call google and write "easter egg".
Then I get this address as an example:
https://www.google.de/search?q=easter+egg&sour...

and as you can see, the search term is also visible there.
(easter + egg).

Of course - I can find GOOGLE with Hyperlink1.navigateto(https://www.google.de/)
but thats not deep enough...

Two questions:

I don't know now whether this address could be found from VFP,
if you only had "Easter eggs" as input - or - a little more clearly:

a) Could you start with a term from VFP (in this example "Easter egg")
in order to get the above mentioned GOOGLE page which includes your term?

b) Could VFP then read and save this link?

Maybe a stupid question - but my father once said:
"There are no stupid questions, only stupid answers"
I hope my question is not a rotten egg

Happy Easter to all of you
Keep healthy


Klaus

Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

(OP)
Meanwhile I answered most of my question myself.
Question a)
Yes.
I created a form with a hyperlink object on it.
Then I added a command-button with this click-code

CODE --> english

term1 = "https://www.google.de/search?q="     *should be a constant as I assume

term2 = "rose+"                               *1th search item
term3 ="lila"                                 *2nd search item
term4 = term1+term2+term3
thisform.Hyperlink1.navigateto(term4)         *opens the requested site. 
this leads to
https://www.google.de/search?q=rose+lila

and I can see a rose coloured lila
Means:
All I have to do is creating a dbf with search-terms in it (may be that there is a free wordbook somewhere), and from there I can start with a listbox on a form to see
what is to be found for my search.
Never something has to be typed then.One click - one site...gg



So question b) is now another one:
can I grab the picture (that lila rose) and store it by using VFP?







Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

I once tried to use Google's feature to say "did you mean..." to check the correct spelling of words. If you automatically search too often (ca. 1000 times) Google will deny answers. To do as many searches as you want you need to pay

That's the one side.

The other is of course you can save pictures. but automate the internet explorer, don't use the hyperlink.
Then you can also use FAQ184-5510: How to save a web Page in a MHTML (web archive ) format. to save the whole page including a folder with the pictures of the page besides other things.

Chriss

RE: Finding an easter-egg in Internet with Visual Foxpro

(OP)
Thanks Criss, this will help me much.
Thank you very much.

Quote (Chriss)

I once tried to use Google's feature to say "did you mean..." to check the correct spelling of words. If you automatically search too often (ca. 1000 times) Google will deny answers. To do as many searches as you want you need to pay

I did not know that before.

What does that mean - 1000 times? In which range of time?
Where can I find more about that?
does google register whether someone entered the term manually or automatically?

Regards
Klaus

Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

Quote:

does google register whether someone entered the term manually or automatically?

Google is certainly clever enough to distinguish between a one-off manual search and a large number of automatic ones. And it will certainly react differently in the two cases. Since Google makes money by showing adverts on search result pages, and since such adverts are only useful to human eyes, it seems likely that the search engine would consider automatic searches unfavourably.

Whether that means a large number of searches, or a number of searches in a given period - I doubt it anyone outside Google knows; and Google is unlikely to tell us.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Finding an easter-egg in Internet with Visual Foxpro

(OP)
Mike, thank you very much for your considerations - I can understand them well.
When I think about it, however, I believe that Google's greatest interest could be that no one could overload the system with program-controlled access.

Quote (Mike)

adverts are only useful to human eyes

Here one could of course argue that the information that is accessed via a machine is ultimately always intended for human eyes.

That applies to text and images - and then it would have to be an advantage for GOOGLE again.
It is also possible to start several different bookmarks in your own browser at the same time without Google refusing to answer.We won't find out what Googles strategy is - and it is not my intention to possibly annoy Google with loop programming.
What I would like to do is to have bookmarks in one form and use them to view images in GOOGLE, because then one can also put a lot of additional information in one form.
For example, a table with the Internet addresses of paintings, but also information about the artist, the painting technique, the origin, the country, etc.
I'll try it - and if Google does not allow that with normal (i.e. not excessive)use, then I'll use a different search engine - and I would also publish my experiences here.

Thanks again.
Klaus


Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

My experience was after a number of searches google answered with a page stating too many searches. So you just don't get results after a while.
You don't have to fear to get prosecuted. I never tried again, today they might even tell you how to get more quota by using their API.

I have to second Mike on the ads. If you run your searches just saving the results of interest, you don't look at their ads, especially if you just follow the links of results. They will need to refund advertisers when thy judge your requests as bulk searching, so they won't earn from these searches.

Chriss

RE: Finding an easter-egg in Internet with Visual Foxpro

(OP)
Hi Chriss and Mike, thank you for your advice on the subject of "Google".
As I already wrote, I would like to access on paintings on the Internet with a VFP form.
Now I think, because of the warnings from Mike and you, I can do that without Google and instead go directly to the URL of an artist.

Example for 2 links:

a) via Google:
https://www.google.de/search?q=abigail+gutting+pic...

b) artist's URL directly
https://www.abigailgutting.com/collections/67791

This eliminates the risk that access to almost the same information no longer works when I try it via Google.

With this I could e.g. save the name of the artist, his painting technique (watercolor), his motifs and his URL etc. in a table and have quick access at any time.

I would like to try it with a FOR-NEXT loop to see if there are any problems, but I don't know whether - and if so, how - Visual Foxpro can close a website after a wait before NEXT comes.

Can VFP do it??


Regards from Germany
Klaus

Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

Why a for loop?

Put your URLs into a table and do a scan..endscan loop.

And you determine when to close the webpage when you release your Internet Explorer Object. And you simply navigate to the next URL in your list to open it and at the same time close the old one, so there is no need to release IE until you navigated to the last URL you have.

I still think you got us wrong, but never mind. The first URL you have is a search request. If you already know the most relevant search result webpage, there's no need to start at Google again, is there? You only use it to discover new artists' web pages, it seems by your interest on how artists paint certain subjects.

Chriss

RE: Finding an easter-egg in Internet with Visual Foxpro

Klaus, going straight to the artist's URL seems much more sensible than searching for the artist in Google. There is no point in doing a search if you already know the URL. Also, you can't guarantee that Google will always return the artist's site at the top of its hits. It's possible that an advertiser might pay for a top listing using similar keywords to the artist's name.

Regarding using a FOR / NEXT loop, there's no reason for this not to work, although, as Chriss pointed out, you might just as well scan a table of URLs. You asked about "closing" a website. There is no concept of opening or closing a website. The website is always there. You just navigate to it, then navigate to somewhere else. (Or did I misunderstand the question?)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Finding an easter-egg in Internet with Visual Foxpro

(OP)
Hi, Mike & Chriss,
Thanks for the hints.
I am afraid I have been misunderstood
I wanted to try this code;
Test program
x = 5 * what happens when x = 200 or more?

mylink = "https://www.abigailgutting.com/"
FOR i = 1 TO x
thisform.Hyperlink1.navigateto (mylink)
WAIT WINDOW
* how to code to close that page in memory now?
ENDFOR


* to avoid overflow in memory - what has to be coded, to close the site after each call on my pc?
* As you can see from the picture attached my browser loads and loads and creates tabs...
* is there something like "Hyperlink1.close .."?

The only problem is that then - the number of tabs in my computer keeps increasing,
and so the main memory will eventually be overcrowded.

Therefore, the program should always close the last page called (I didn't want to do that by hand).

I wanted to find out what, a call via Google would do if, for example, a page was called up over and over again 200 times.
Therefore the mentioned loop - I was curious how often this works before the system replies "too many calls"
I know that I can call up different pages one after another with scan ... endscan,
I only wanted not to close it myself (e.g. marking the "X" right on top manually).
I wanted to close a website with VFP
Addition:
Imagine you want to have a dis-show of pages - but don't want to have a new tab for each called page - how to avoid this?
I hope I expressed myself better this time.

Greetings
Klaus

Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

(OP)
This is how my pc looks (see list of tabs)

Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

If I've understood this right, when you say you want to "close the website", what you really want to do is to close the browser tab. (As I mentioned earlier, there is no concept of opening or closing websites.)

I don't know of any way of closing a tab programmatically with the Hyperlink object, because you don't have an object reference to the browser (as far as I know). But I wonder if there is a setting in the browser to tell it to use the same tab for each URL request? Alternatively, I think there is a setting within Google where you can tell it to open the target URL in the same tab as the search results. Maybe that will solve the problem?

UPDATE:
In Google Search settings, there is an option labelled "Open each selected result in a new browser window". I wonder if switching that option off would help solve the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Finding an easter-egg in Internet with Visual Foxpro

(OP)
Mike
You are right, i tried serveral things, but failed.
The only way is indeed to change something in the browser.

In my browser (FIREFOX) this can be done in the settings.
The default there is :
"open the link in tabs instead of in new windows" -
that is normally ok, as you can see what has been done etc.

By removing the cross in that setting FIREFOX shows always only one Homepage.
I tested it with my loop and always the same URL.

I am happy that I have learned something again.

Best regards
Klaus

Peace worldwide - it starts here...

RE: Finding an easter-egg in Internet with Visual Foxpro

Klaus,

You mentioned the setting in Firefox. However, when you call Navigate2 for a Hyperlink object, it always invokes Internet Explorer (or whatever we are supposed to call it these days). So changing a setting in Firefox won't make any difference.

However, Internet Explorer has a setting: Tools -> Internet Options -> General tab -> Tabs button. Under "Open links from other programs in:", there is an option, "The current tab or window". I don't know how useful that would be, but it might be worth experimenting.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close