小编jea*_*les的帖子

Youtube API - 在特定时间抓取视频的屏幕截图

我希望在特定时间生成 youtube 视频的高清屏幕截图。假设我有 Youtube 视频 ID (ctiJc4yEVow),我想要 1:32 出现的屏幕截图。有没有一种干净且易于实施的方法来做到这一点?我已经阅读了使用 ffmpeg 的方法和一些杂项草率的代码,但没有什么可靠的。

我唯一看到的是如何为视频生成图像,不针对任何时间。

https://i1.ytimg.com/vi/ /default.jpg

我的问题是我需要一个特定的时间。请帮忙!

php youtube video youtube-api

5
推荐指数
1
解决办法
2717
查看次数

如何使用PHP提取API数据并将其添加到数据库中?

我希望从CrunchBase API中提取公司列表的数据,然后将该数据添加到数据库中的选择表中.我真的不知道从哪里开始.我一直在看cURL.

我现在在哪里:

$url = "http://api.crunchbase.com/v/1/company/audible-coffee.js?api_key=API_KEY&callback=?";
$data = get_data($url);
// Note: ideally you should use DOM manipulation to inject the <base>
// tag inside the <head> section
$data = str_replace("<head>", "<head><base href=\"$url\">", $data);
echo $data;


function get_data($url) {
  $ch = curl_init();
  $timeout = 5;
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  curl_close($ch);
  return $data;
}
Run Code Online (Sandbox Code Playgroud)

我想我现在应该解析它,然后将数据存储在数据库中.

我在解析数据时找到代码的努力如下:

$json_string = '<url.json>';

$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata, true);
print_r($obj['Result']);
Run Code Online (Sandbox Code Playgroud)

不幸的是,我不知道自己在做什么,所以对于改变什么或从哪里去的任何意见都将非常感激.

php json curl

4
推荐指数
1
解决办法
5368
查看次数

Twitter API - 获取帐户的转发计数

我希望获取特定用户收到的转发总数。那可能吗?

现在,我可以获取推文总数、关注者数量和好友数量。

我正在使用的代码是:

$username = "username";
$url = "https://api.twitter.com/1.1/users/show.json";
$requestMethod = "GET";
$getfield = "?screen_name=".$username."&include_entities=true";
$twitter = new TwitterAPIExchange($settings);
$string = json_decode($twitter->setGetfield($getfield)
    ->buildOauth($url, $requestMethod)
    ->performRequest(),$assoc = TRUE);
Run Code Online (Sandbox Code Playgroud)

php twitter json

3
推荐指数
1
解决办法
7030
查看次数

标签 统计

php ×3

json ×2

curl ×1

twitter ×1

video ×1

youtube ×1

youtube-api ×1