Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wiedermal Reguläre Ausdrücke

Empfohlene Antworten

Veröffentlicht

Moin allerseits...

ich möchte per php die Anzahl der Suchergebnisse bei Google herauslesen....

dazu lese ich die seite ein und versuche das ganze uber Reguläre Ausdrücke zu filtern.... Aber nix kommt bei raus!

Wer kann mir helfen?

danke & mfg

mein code:

<?php
$handle = fopen("http://www.google.de/search?q=Fachinformatiker&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:de-DE:official", "r");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}


if (eregi('ungefähr <b>(.*)</b> für',$contents,$count)){
var_dump($count);
}


fclose($handle);
?> [/PHP]

hast du mal nachgefragt ob es diese Information als XML oder so gibt ?

ich weis das manche Suchmaschinen (Google inclusive) sonderoptionen für Seitenbetreiber haben.

Bestimmten Inhalt aus einer fremden Seite auslesen halte ich für 'bäh' ... und bin mir nicht sicher wie das rechtlich aussieht. Selbst wenn es nur so eine kleine "zahl" ist.


	<?php

		$handle = fopen("http://www.google.de/search?q=Fachinformatiker&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:de-DE:official", "r");


		$count = -1;

		while ($count == -1 && $handle && !feof($handle)) {	//Hier bitte auch das Handle validieren, sonst kommst Du bei einem Fehler ggf. in eine Endlosschleife voller Warnings 

			$line = fread($handle, 8192);

			if (preg_match('/ungefähr <b>([^<]*)</b> für/is',$line,$pregRes)) {

				$count = $pregRes[1];

			}

		}				


		if $handle

			fclose($handle);

	?> 

[/code]

danke für eure posts....

ich habe jetzt herausgefunden dass es google api gibt... doort gibt es viele features die man nutzen kann...

thx

danke für eure posts....

ich habe jetzt herausgefunden dass es google api gibt... doort gibt es viele features die man nutzen kann...

thx

Hast du auch ein Paar links dazu?

Danke und Gruß,

Markus

würd auch einfach den webservice von google nutzen

mfg byte

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.