]> git.mxchange.org Git - friendica.git/blob - include/Scrape.php
Move Probe to src
[friendica.git] / include / Scrape.php
1 <?php
2
3 use Friendica\Network\Probe;
4
5 /**
6  *
7  * Probe a network address to discover what kind of protocols we need to communicate with it.
8  *
9  * Warning: this function is a bit touchy and there are some subtle dependencies within the logic flow.
10  * Edit with care.
11  *
12  */
13
14 /**
15  *
16  * PROBE_DIASPORA has a bias towards returning Diaspora information
17  * while PROBE_NORMAL has a bias towards dfrn/zot - in the case where
18  * an address (such as a Friendica address) supports more than one type
19  * of network.
20  *
21  */
22
23 define('PROBE_NORMAL',   0);
24 define('PROBE_DIASPORA', 1);
25
26 function probe_url($url, $mode = PROBE_NORMAL, $level = 1) {
27
28         if ($mode == PROBE_DIASPORA)
29                 $network = NETWORK_DIASPORA;
30         else
31                 $network = "";
32
33         $data = Probe::uri($url, $network);
34
35         return $data;
36 }