-
Notifications
You must be signed in to change notification settings - Fork 13
/
Pinterest.php
42 lines (38 loc) · 948 Bytes
/
Pinterest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @link https://github.com/yiimaker/yii2-social-share
* @copyright Copyright (c) 2017-2019 Yii Maker
* @license BSD 3-Clause License
*/
namespace ymaker\social\share\drivers;
use ymaker\social\share\base\AbstractDriver;
/**
* Driver for Pinterest.
*
* @link https://pinterest.com
*
* @author Vladimir Kuprienko <vldmr.kuprienko@gmail.com>
* @since 1.0
*/
class Pinterest extends AbstractDriver
{
/**
* {@inheritdoc}
*/
protected function processShareData()
{
$this->url = static::encodeData($this->url);
$this->imageUrl = static::encodeData($this->imageUrl);
$this->description = static::encodeData($this->description);
}
/**
* {@inheritdoc}
*/
protected function buildLink()
{
return 'https://www.pinterest.com/pin/create/link/?'
. 'url={url}'
. '&media={imageUrl}'
. '&description={description}';
}
}