Skip to content

Commit

Permalink
Merge branch 'release/1.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisAlejandro committed Sep 5, 2023
2 parents 35e9671 + 026a77b commit 0aa89be
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Building docker image
uses: docker/build-push-action@v4
with:
tags: ghcr.io/luisalejandro/agoras-actions:1.1.2
tags: ghcr.io/luisalejandro/agoras-actions:1.1.3
file: docker/Dockerfile
context: docker
cache-from: type=gha
Expand Down
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog


## 1.1.3 (2023-09-05)

### Changed

* Adding support for --status-link. [Luis Alejandro Martínez Faneyth]


## 1.1.2 (2023-09-03)

### Fixed
Expand Down
90 changes: 77 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

---

Current version: 1.1.2
Current version: 1.1.3

Agoras is a python utility that helps publish and delete posts on the most popular social networks (twitter, facebook, instagram and linkedin).

Expand All @@ -20,7 +20,7 @@ jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: LuisAlejandro/[email protected].2
- uses: LuisAlejandro/[email protected].3
with:
network: facebook
action: post
Expand Down Expand Up @@ -54,14 +54,14 @@ jobs:
publish-like:
runs-on: ubuntu-22.04
steps:
- uses: LuisAlejandro/[email protected].2
- uses: LuisAlejandro/[email protected].3
id: agoras
with:
network: linkedin
action: post
status-text: This is a test post
linkedin-access-token: ZCNqH3bT0as2ZBB...
- uses: LuisAlejandro/[email protected].2
- uses: LuisAlejandro/[email protected].3
with:
network: linkedin
action: like
Expand All @@ -73,6 +73,16 @@ jobs:

* `network`: Social network to use for publishing. Must be one of twitter, facebook, instagram or linkedin.
* `action`: Action to execute. Must be one of like, share, last-from-feed, random-from-feed, schedule, post, delete.
* `status-text`: Text to be published.
* `status-link`: Link to be published.
* `status-image-url-1`: First image URL to be published.
* `status-image-url-2`: Second image URL to be published.
* `status-image-url-3`: Third image URL to be published.
* `status-image-url-4`: Fourth image URL to be published.
* `feed-url`: URL of public Atom feed to be parsed.
* `max-count`: Max number of new posts to be published at once.
* `post-lookback`: Only allow posts published
* `max-post-age`: Dont allow publishing of posts older than this number of days.
* `twitter-consumer-key`: Twitter consumer key from twitter developer app.
* `twitter-consumer-secret`: Twitter consumer secret from twitter developer app.
* `twitter-oauth-token`: Twitter OAuth token from twitter developer app.
Expand All @@ -87,20 +97,74 @@ jobs:
* `instagram-post-id`: Instagram ID of post to be liked, shared or deleted.
* `linkedin-access-token`: Your LinkedIn access token.
* `linkedin-post-id`: LinkedIn post ID to like, share or delete.
* `status-text`: Text to be published.
* `status-image-url-1`: First image URL to be published.
* `status-image-url-2`: Second image URL to be published.
* `status-image-url-3`: Third image URL to be published.
* `status-image-url-4`: Fourth image URL to be published.
* `feed-url`: URL of public Atom feed to be parsed.
* `max-count`: Max number of new posts to be published at once.
* `post-lookback`: Only allow posts published
* `max-post-age`: Dont allow publishing of posts older than this number of days.
* `google-sheets-client-email`: A google console project client email corresponding to the private key.
* `google-sheets-private-key`: A google console project private key.
* `google-sheets-id`: The google sheets ID to read schedule entries.
* `google-sheets-name`: The name of the sheet where the schedule is.

## Examples

* Publish post to LinkedIn using `status-link`, which embeds a preview of an URL in the post.

```yml
on:
workflow_dispatch:
jobs:
publish-like:
runs-on: ubuntu-22.04
steps:
- uses: LuisAlejandro/[email protected]
with:
network: linkedin
action: post
status-text: This is a test post
status-link: https://luisalejandro.org/blog/posts/nuevo-blog
linkedin-access-token: ZCNqH3bT0as2ZBB...
```

* Publish post to Facebook with multiple images.

```yml
on:
workflow_dispatch:
jobs:
publish-like:
runs-on: ubuntu-22.04
steps:
- uses: LuisAlejandro/[email protected]
with:
network: facebook
action: post
status-text: This is a test post
status-image-url-1: https://pbs.twimg.com/media/Ej3d42zXsAEfDCr?format=jpg
status-image-url-2: https://pbs.twimg.com/media/Ej3d42zXsAEfDCr?format=jpg
status-image-url-3: https://pbs.twimg.com/media/Ej3d42zXsAEfDCr?format=jpg
status-image-url-4: https://pbs.twimg.com/media/Ej3d42zXsAEfDCr?format=jpg
facebook-access-token: ZCNqH3bT0as2ZBB...
facebook-object-id: 8974765243478...
```

* Publish last post from feed to Facebook. This requires a cron to continuously check for new posts. The cron in this example runs every hour. `max-count` is set to 1 to only publish one post at a time. `post-lookback` is set to 3600 to only publish posts that are less than 1 hour old. This is to avoid publishing the same post multiple times.

```yml
on:
schedule:
- cron: 0 * * * *
jobs:
publish-like:
runs-on: ubuntu-22.04
steps:
- uses: LuisAlejandro/[email protected]
with:
network: facebook
action: last-from-feed
feed-url: https://luisalejandro.org/blog/posts/feed.xml
max-count: 1
post-lookback: 3600
facebook-access-token: ZCNqH3bT0as2ZBB...
facebook-object-id: 8974765243478...
```

## Made with 💖 and 🍔

![Banner](https://raw.githubusercontent.com/LuisAlejandro/LuisAlejandro/master/images/author-banner.svg)
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ inputs:
status-text:
description: Text to be published.
required: false
status-link:
description: Link to be published.
required: false
status-image-url-1:
description: First image URL to be published.
required: false
Expand Down Expand Up @@ -96,7 +99,7 @@ outputs:

runs:
using: docker
image: docker://ghcr.io/luisalejandro/agoras-actions:1.1.2
image: docker://ghcr.io/luisalejandro/agoras-actions:1.1.3
args:
- network="${{ inputs.network }}"
- action="${{ inputs.action }}"
Expand All @@ -115,6 +118,7 @@ runs:
- linkedin-access-token="${{ inputs.linkedin-access-token }}"
- linkedin-post-id="${{ inputs.linkedin-post-id }}"
- status-text="${{ inputs.status-text }}"
- status-link="${{ inputs.status-link }}"
- status-image-url-1="${{ inputs.status-image-url-1 }}"
- status-image-url-2="${{ inputs.status-image-url-2 }}"
- status-image-url-3="${{ inputs.status-image-url-3 }}"
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \

RUN apt-get update && apt-get install jq

RUN pip3 install agoras==1.1.2
RUN pip3 install agoras==1.1.3

ADD entrypoint.sh /entrypoint.sh
ADD execute.py /execute.py
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.2
current_version = 1.1.3
tag_name = {new_version}
commit = True
tag = True
Expand Down
1 change: 1 addition & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python3 docker/execute.py \
network="twitter" \
action="post" \
status-text="${STATUS_TEXT}" \
status-link="${STATUS_LINK}" \
status-image-url-1="${STATUS_IMAGE_URL_1}" \
status-image-url-2="${STATUS_IMAGE_URL_2}" \
status-image-url-3="${STATUS_IMAGE_URL_3}" \
Expand Down

0 comments on commit 0aa89be

Please sign in to comment.