Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #274 from seregazhuk/develop
Browse files Browse the repository at this point in the history
bot wait
  • Loading branch information
seregazhuk authored May 1, 2017
2 parents 54c9657 + bdbeec3 commit f73d6c3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Change Log
All notable changes to this project will be documented in this file.

## v5.3.6 - 2017-05-01
### Added
- bot wait() method

## v5.3.5 - 2017-04-23
### Fixed:
- Bot getClientInfo() method

## v5.3.4 - 2017-04-23
### Fixed:
- Boards forMe method
- Pinners followers uses limit
- Boards forMe() method
- Pinners followers() uses limit

## v5.3.3 - 2017-04-22
### Updated:
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@ $boards = $bot->boards->forUser('yourUserName');

// Create a pin
$bot->pins->create('http://exmaple.com/image.jpg', $boards[0]['id'], 'Pin description');

// Wait 5 seconds
$bot->wait(5);
```

*Note*: Some methods use pinterest navigation through results (with bookmarks), for example, get user followers/following, pins
likes/dislikes, search and other feed queries. This means that for every batch of results there will be a
request to Pinterest. These methods return a [Pagination] object with Pinterest api results.
request to Pinterest. These methods return a [Pagination](#pagination) object with Pinterest api results.

**How to avoid banned from Pinterest**: don't bee too aggressive making pins or writing comments.
Try to put some timeouts with `$bot->wait($seconds)` calls, so you will behave like a real person and not a bot,
creating hundreds of pins in a minute.

## Examples
Here you can find some simple scripts with most common tasks that can be done with bot:
Expand Down
12 changes: 12 additions & 0 deletions src/Bot.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,16 @@ public function getClientInfo($reload = false)

return $this->providersContainer->getClientInfo();
}

/**
* Creates a timeout
* @param int $seconds
* @return $this
*/
public function wait($seconds = 1)
{
sleep($seconds);

return $this;
}
}

0 comments on commit f73d6c3

Please sign in to comment.