Guest User

Untitled

a guest
Jan 23rd, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Name
  2. Requests
  3. Errors (%)
  4. Latency, median (ms)
  5. Latency, 95% (ms)
  6. Indexing API 1 0 393 511
  7.  
  8. $url='https://www.yuvajobs.com/government-jobs/manit-maulana-azad-national-institute-of-technology-recruitment-6993.html';
  9.  
  10. $client = new Google_Client();
  11.  
  12. // service_account_file.json is the private key that you created for your service account.
  13. $client->setAuthConfig('service_account_file.json');
  14. $client->addScope('https://www.googleapis.com/auth/indexing');
  15.  
  16.  
  17. // Get a Guzzle HTTP Client
  18. $httpClient = $client->authorize();
  19. $endpoint = 'https://indexing.googleapis.com/v3/urlNotifications:publish';
  20.  
  21. $content = "{
  22. "url": "".$url."",
  23. "type": "URL_UPDATED"
  24. }";
  25.  
  26. $response = $httpClient->post($endpoint, [ 'body' => $content ]);
  27.  
  28. $status_code = $response->getStatusCode();
  29. print_r($status_code).' : ';
Add Comment
Please, Sign In to add comment