Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfredinni committed Dec 13, 2018
1 parent 0926266 commit b8e7329
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ ASALocalRun/

# End of https://www.gitignore.io/api/vim,osx,linux,macos,python,windows,pycharm,sublimetext,visualstudio,visualstudiocode
# Personal development files
docs/source/_build
import.py
me.jpeg
mac.jpeg
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@

## [Unreleased]

### Added

- Added support to post updates randomly on `Coo.tweet(aleartory=True)`.
- Added support for updates with a single media file for all tweets on `Coo.tweet()`.
- Added support for updates with a single media file for all tweets on `Coo.schedule()`.
- Added support for updates with a different media file for each tweet on `Coo.schedule()`.

## [0.1.2] - 2018-11-29

### Fixed

- Fixed template overwriting the updates when `$message` is not provided.
- Fixed lots of typos.

## [0.1.1] - 2018-11-21

### Fixed

- Fixed typos and README_P.rst for PyPI

## [0.1.0] - 2018-11-21
Expand Down
86 changes: 70 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,13 @@ at.tweet(tweets, delay="13:45", interval="four_hours", template=my_template)

For more detailed options and usage, keep reading or check the [documentation](https://coo.readthedocs.io/en/latest/) :blue_book:.

## TODO's

- [ ] Add support for random updates.
- [ ] Add support for media files on `Coo.tweet`.
- [ ] Add support for media files on `Coo.schedule`.
- [ ] Add support for multiple media files on `Coo.tweet`.
- [ ] Add support for multiple media files on `Coo.schedule`.
- [ ] Add support for media files from URLs.
- [ ] Add support for one template for all updates on `Coo.schedule`.
- [ ] Add logging support.
- [ ] Support `.toml` files for configuration and tweets.
- [ ] Support resume after a process restart (see [apscheduler](https://github.com/agronholm/apscheduler)).
- [ ] Add a CLI.


## Scheduling Twitter Updates

Schedule updates with `datetime` strings or integers and use [custom templates](#Templates) if needed.

```python
Coo.schedule(updates, time_zone)
Coo.schedule(updates, time_zone, media)
```

Full example:
Expand Down Expand Up @@ -151,12 +137,50 @@ at.schedule(tweets, time_zone="America/Santiago")

Here you can find all the [Time Zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) available.

#### Media files

There are two ways to add media files to your tweets. The first and easiest is to use one global file for all the updates:

```python
at.schedule(tweets, time_zone="America/Santiago", media="path/to/file.png")
```

Also, an individual file can be set for each one of the updates:

```python
tweets = [
("2030-10-28 18:50", template, "Update with an image.", "pics/owl.png"),
("2030-10-29 18:15", template, "Update with other media.", "videos/funny_video.mp4"),
("2030-11-01 13:45", template, "Tweet without media."),
]
```

Finally, it is possible to combine these to ways. For example, if most of the tweets are gonna use the same media and just a few will have a different or none:

```python
tweets = [
("2030-11-01 13:45", template, "Tweet with global media."),
("2030-11-02 13:45", template, "Tweet with global media."),
("2030-11-03 13:45", template, "Tweet with global media."),
("2030-11-04 13:45", template, "Tweet with global media."),
("2030-11-05 13:45", template, "Tweet with global media."),
("2030-11-06 13:45", template, "Tweet with global media."),
("2030-11-07 13:45", template, "Tweet with global media."),
("2030-11-08 13:45", template, "Tweet without media.", None),
("2030-11-09 13:45", template, "Tweet without media.", None),
("2030-12-10 18:50", template, "Update with an image.", "pics/owl.png"),
("2030-12-11 18:15", template, "Update with other media.", "videos/funny_video.mp4"),
]

at.schedule(tweets, time_zone="America/Santiago", media="path/to/global_media.png")
```

## Tweet a list of strings

Post ordered updates with `delay`, `interval`, and a [template](#Templates) if needed.

```python
Coo.tweet(updates, delay, interval, template, time_zone)
Coo.tweet(updates, delay, interval, template, media, time_zone, aleatory)
```

```python
Expand Down Expand Up @@ -221,6 +245,22 @@ And of course, you can also set one [template](#Templates) for each one of the u
at.tweet(tweets, template=template)
```

#### Media files

Use one media file for all of your updates:

```python
at.tweet(tweets, media="path/to/media.jpeg")
```

#### Random updates

To tweet your updates randomly:

```python
at.tweet(tweets, aleatory=True)
```

#### Delay and Interval Keywords

| Keyword | Seconds |
Expand Down Expand Up @@ -284,6 +324,20 @@ retweets = at.api.GetRetweets()

And a lot more. If you are interested, check their [documentation](https://python-twitter.readthedocs.io/en/latest/index.html).

## TODO's

- [x] Add support for random updates.
- [x] Add support for media files on `Coo.tweet`.
- [x] Add support for individual and single media files on `Coo.schedule`.
- [ ] Add support for multiple media files on `Coo.tweet`.
- [ ] Add support for multiple media files on `Coo.schedule`.
- [ ] Add support for media files from URLs.
- [ ] Add support for one template for all updates on `Coo.schedule`.
- [ ] Add logging support.
- [ ] Support `.toml` files for configuration and tweets.
- [ ] Support resume after a process restart (see [apscheduler](https://github.com/agronholm/apscheduler)).
- [ ] Add a CLI.

## Documentation

Documentation available at [coo.readthedocs.io](https://coo.readthedocs.io/en/latest/).
57 changes: 57 additions & 0 deletions README_P.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,45 @@ Parsing DateTime strings
Here you can find all the
`Time Zones <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_.
Media Files
^^^^^^^^^^^
There are two ways to add media files to your tweets. The first and easiest is to use one global file for all the updates:
.. code-block:: python
at.schedule(tweets, time_zone="America/Santiago", media="path/to/file.png")
Also, an individual file can be set for each one of the updates:
.. code-block:: python
tweets = [
("2030-10-28 18:50", template, "Update with an image.", "pics/owl.png"),
("2030-10-29 18:15", template, "Update with other media.", "videos/funny_video.mp4"),
("2030-11-01 13:45", template, "Tweet without media."),
]
Finally, it is possible to combine these to ways. For example, if most of the tweets are gonna use the same media and just a few will have a different or none:
.. code-block:: python
tweets = [
("2030-11-01 13:45", template, "Tweet with global media."),
("2030-11-02 13:45", template, "Tweet with global media."),
("2030-11-03 13:45", template, "Tweet with global media."),
("2030-11-04 13:45", template, "Tweet with global media."),
("2030-11-05 13:45", template, "Tweet with global media."),
("2030-11-06 13:45", template, "Tweet with global media."),
("2030-11-07 13:45", template, "Tweet with global media."),
("2030-11-08 13:45", template, "Tweet without media.", None),
("2030-11-09 13:45", template, "Tweet without media.", None),
("2030-12-10 18:50", template, "Update with an image.", "pics/owl.png"),
("2030-12-11 18:15", template, "Update with other media.", "videos/funny_video.mp4"),
]
at.schedule(tweets, time_zone="America/Santiago", media="path/to/global_media.png")
Tweet an ordered list of strings
================================
Expand Down Expand Up @@ -206,6 +245,24 @@ Use integers as seconds or some strings as `Keywords`_: ``half_hour``, ``one_hou
# integers
at.tweet(tweets, interval=14400)
Media files
^^^^^^^^^^^
Use one media file for all of your updates:
.. code-block:: python
at.tweet(tweets, media="path/to/media.jpeg")
Random updates
^^^^^^^^^^^^^^
To tweet your updates randomly:
.. code-block:: python
at.tweet(tweets, aleatory=True)
Keywords
^^^^^^^^
Expand Down
18 changes: 18 additions & 0 deletions docs/source/list_schedule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,24 @@ Use integers as seconds or some strings as `Keywords`_: ``half_hour``, ``one_hou
# integers
at.tweet(tweets, interval=14400)
Media files
^^^^^^^^^^^

Use one media file for all of your updates:

.. code-block:: python
at.tweet(tweets, media="path/to/media.jpeg")
Random updates
^^^^^^^^^^^^^^

To tweet your updates randomly:

.. code-block:: python
at.tweet(tweets, aleatory=True)
Keywords
^^^^^^^^

Expand Down
39 changes: 39 additions & 0 deletions docs/source/schedule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,45 @@ Parsing DateTime strings

Here you can find all the `Time Zones <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_.

Media Files
^^^^^^^^^^^

There are two ways to add media files to your tweets. The first and easiest is to use one global file for all the updates:

.. code-block:: python
at.schedule(tweets, time_zone="America/Santiago", media="path/to/file.png")
Also, an individual file can be set for each one of the updates:

.. code-block:: python
tweets = [
("2030-10-28 18:50", template, "Update with an image.", "pics/owl.png"),
("2030-10-29 18:15", template, "Update with other media.", "videos/funny_video.mp4"),
("2030-11-01 13:45", template, "Tweet without media."),
]
Finally, it is possible to combine these to ways. For example, if most of the tweets are gonna use the same media and just a few will have a different or none:

.. code-block:: python
tweets = [
("2030-11-01 13:45", template, "Tweet with global media."),
("2030-11-02 13:45", template, "Tweet with global media."),
("2030-11-03 13:45", template, "Tweet with global media."),
("2030-11-04 13:45", template, "Tweet with global media."),
("2030-11-05 13:45", template, "Tweet with global media."),
("2030-11-06 13:45", template, "Tweet with global media."),
("2030-11-07 13:45", template, "Tweet with global media."),
("2030-11-08 13:45", template, "Tweet without media.", None),
("2030-11-09 13:45", template, "Tweet without media.", None),
("2030-12-10 18:50", template, "Update with an image.", "pics/owl.png"),
("2030-12-11 18:15", template, "Update with other media.", "videos/funny_video.mp4"),
]
at.schedule(tweets, time_zone="America/Santiago", media="path/to/global_media.png")
Templates
^^^^^^^^^

Expand Down

0 comments on commit b8e7329

Please sign in to comment.