<?php
// Your details
$token = "abcdefg1234567";
$email = "abc@gmail.com";
$timestamp = time();
// Build hash
$hash = hash('sha256', $token . "|" . $timestamp . "|" . $email);
// Build url
$myUrl = "http://admin.plugrush.com/api/v2/stats/publisher/dates?hash=" . $hash . "×tamp=" . $timestamp . "&email=" . $email;
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, $myUrl);
// return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string, which is the result of the api request
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
?>
请问这段代码怎么写成python,一个官方文档的API,无奈不懂PHP。
谢谢。
就是用http发送一个get请求,你用python实现一下就好了。