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