Now that we're losing access to Yahoo's index, we need to migrate existing copyvio tools to using a different API.
Description
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T116957 Plagiarism detection tools for text (tracking) | |||
Resolved | Earwig | T131175 Help Copyvio Detector migrate to a new API |
Event Timeline
Comment Actions
The authorization for the new API is done through a basic authorization header passed as part of the API request.
In PHP this would be implemented something like:
$accountKey = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; $webSearchURL = 'https://api.datamarket.azure.com/Bing/Search/Web?$format=json&Query='; $context = stream_context_create(array( 'http' => array( 'request_fulluri' => true, 'header' => "Authorization: Basic " . base64_encode($accountKey . ":" . $accountKey) ) )); $request = $webSearchURL . urlencode( '\'' . $_POST["searchText"] . '\''); $response = file_get_contents($request, 0, $context); $jsonobj = json_decode($response);