chore: update and merge gitignore
This commit is contained in:
230
.gitignore
vendored
Normal file
230
.gitignore
vendored
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
# =========================
|
||||||
|
# Custom Project Files
|
||||||
|
# =========================
|
||||||
|
config.json
|
||||||
|
/config.json
|
||||||
|
/path/
|
||||||
|
/.idea/
|
||||||
|
*.log
|
||||||
|
*.png
|
||||||
|
*.tw_session
|
||||||
|
*.tw_session-journal
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,macos,windows
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
### macOS ###
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
### macOS Patch ###
|
||||||
|
# iCloud generated files
|
||||||
|
*.icloud
|
||||||
|
|
||||||
|
### Python ###
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
*.py,cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
cover/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
db.sqlite3-journal
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
.pybuilder/
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pdm
|
||||||
|
.pdm.toml
|
||||||
|
|
||||||
|
# PEP 582
|
||||||
|
__pypackages__/
|
||||||
|
|
||||||
|
# Celery stuff
|
||||||
|
celerybeat-schedule
|
||||||
|
celerybeat.pid
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
# pytype static type analyzer
|
||||||
|
.pytype/
|
||||||
|
|
||||||
|
# Cython debug symbols
|
||||||
|
cython_debug/
|
||||||
|
|
||||||
|
### Python Patch ###
|
||||||
|
# Poetry local configuration file
|
||||||
|
poetry.toml
|
||||||
|
|
||||||
|
# ruff
|
||||||
|
.ruff_cache/
|
||||||
|
|
||||||
|
# LSP config files
|
||||||
|
pyrightconfig.json
|
||||||
|
|
||||||
|
### VisualStudioCode ###
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/*.code-snippets
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Built Visual Studio Code Extensions
|
||||||
|
*.vsix
|
||||||
|
|
||||||
|
### VisualStudioCode Patch ###
|
||||||
|
# Ignore all local history of files
|
||||||
|
.history
|
||||||
|
.ionide
|
||||||
|
|
||||||
|
### Windows ###
|
||||||
|
# Windows thumbnail cache files
|
||||||
|
Thumbs.db
|
||||||
|
Thumbs.db:encryptable
|
||||||
|
ehthumbs.db
|
||||||
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
# Dump file
|
||||||
|
*.stackdump
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
[Dd]esktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
674
LICENSE
Normal file
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
37
README.md
Normal file
37
README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
RSS to Bluesky - in Python
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
This is a proof-of-concept implementation for posting RSS/Atom content to Bluesky. Some hacking may be required. Issues and pull requests welcome to improve the system.
|
||||||
|
|
||||||
|
|
||||||
|
## Built with:
|
||||||
|
|
||||||
|
* [arrow](https://arrow.readthedocs.io/) - Time handling for humans
|
||||||
|
* [atproto](https://github.com/MarshalX/atproto) - AT protocol implementation for Python. The API of the library is still unstable, but the version is pinned in requirements.txt
|
||||||
|
* [fastfeedparser](https://github.com/kagisearch/fastfeedparser) - For feed parsing with a unified API
|
||||||
|
* [httpx](https://www.python-httpx.org/) - For grabbing remote media
|
||||||
|
|
||||||
|
|
||||||
|
## Features:
|
||||||
|
|
||||||
|
* Deduplication: The script queries the target timeline and only posts RSS items that are more recent than the latest top-level post by the handle.
|
||||||
|
* Filters: Easy to extend code to support filters on RSS contents for simple transformations and limiting cross-posts.
|
||||||
|
* Minimal rich-text support (links): Rich text is represented in a typed hierarchy in the AT protocol. This script currently performs post-processing on filtered string content of the input feeds to support links as long as they stand as a single line in the text. This definitely needs some improvement.
|
||||||
|
* Threading for long posts
|
||||||
|
* Tags
|
||||||
|
* Image references: Can forward image links from RSS to Bsky
|
||||||
|
|
||||||
|
## Usage and configuration
|
||||||
|
|
||||||
|
1. Start by installing the required libraries `pip install -r requirements.txt`
|
||||||
|
2. Copy the configuration file and then edit it `cp config.json.sample config.json`
|
||||||
|
3. Run the script like `python rss2bsky.py`
|
||||||
|
|
||||||
|
The configuration file accepts the configuration of:
|
||||||
|
|
||||||
|
* a feed URL
|
||||||
|
* bsky parameters for a handle, username, and password
|
||||||
|
* Handle is like name.bsky.social
|
||||||
|
* Username is the email address associated with the account.
|
||||||
|
* Password is your password. If you have a literal quote it can be escaped with a backslash like `\"`
|
||||||
|
* sleep - the amount of time to sleep while running
|
||||||
12
cookie_login.py
Normal file
12
cookie_login.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from tweety import Twitter
|
||||||
|
|
||||||
|
# This creates a local session file so you only log in once
|
||||||
|
app = Twitter("my_account_session")
|
||||||
|
|
||||||
|
# Log in with your credentials
|
||||||
|
app.sign_in("grijanderm59258", "Bo3usi!!")
|
||||||
|
|
||||||
|
# Fetch the tweets
|
||||||
|
tweets = app.get_tweets("meteocat", pages=1)
|
||||||
|
for tweet in tweets:
|
||||||
|
print(tweet.text)
|
||||||
0
jenkins/3catJenkinsfile
Normal file
0
jenkins/3catJenkinsfile
Normal file
103
requeriments.txt
Normal file
103
requeriments.txt
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
Package Version
|
||||||
|
------------------- -------------
|
||||||
|
2captcha-python 2.0.4
|
||||||
|
aiofiles 25.1.0
|
||||||
|
aiosqlite 0.22.1
|
||||||
|
annotated-doc 0.0.4
|
||||||
|
annotated-types 0.7.0
|
||||||
|
anticaptchaofficial 1.0.69
|
||||||
|
anyio 4.12.1
|
||||||
|
arrow 1.4.0
|
||||||
|
atproto 0.0.65
|
||||||
|
attrs 25.4.0
|
||||||
|
beautifulsoup4 4.14.3
|
||||||
|
blis 1.3.3
|
||||||
|
capsolver 1.0.7
|
||||||
|
catalogue 2.0.10
|
||||||
|
certifi 2026.2.25
|
||||||
|
cffi 2.0.0
|
||||||
|
charset-normalizer 3.4.5
|
||||||
|
chromedriver-binary 74.0.3729.6.0
|
||||||
|
click 8.3.1
|
||||||
|
cloudpathlib 0.23.0
|
||||||
|
confection 0.1.5
|
||||||
|
cryptography 46.0.5
|
||||||
|
cymem 2.0.13
|
||||||
|
dateutils 0.6.12
|
||||||
|
dnspython 2.8.0
|
||||||
|
et_xmlfile 2.0.0
|
||||||
|
fake-useragent 2.2.0
|
||||||
|
fastfeedparser 0.5.9
|
||||||
|
greenlet 3.3.2
|
||||||
|
h11 0.16.0
|
||||||
|
h2 4.3.0
|
||||||
|
hpack 4.1.0
|
||||||
|
httpcore 1.0.9
|
||||||
|
httpx 0.28.1
|
||||||
|
hyperframe 6.1.0
|
||||||
|
idna 3.11
|
||||||
|
Jinja2 3.1.6
|
||||||
|
joblib 1.5.3
|
||||||
|
libipld 3.3.2
|
||||||
|
loguru 0.7.3
|
||||||
|
lxml 6.0.2
|
||||||
|
markdown-it-py 4.0.0
|
||||||
|
MarkupSafe 3.0.3
|
||||||
|
mdurl 0.1.2
|
||||||
|
murmurhash 1.0.15
|
||||||
|
nltk 3.9.3
|
||||||
|
numpy 2.4.3
|
||||||
|
openpyxl 3.1.5
|
||||||
|
outcome 1.3.0.post0
|
||||||
|
packaging 26.0
|
||||||
|
pandas 3.0.1
|
||||||
|
pip 26.0.1
|
||||||
|
playwright 1.58.0
|
||||||
|
preshed 3.0.12
|
||||||
|
py 1.11.0
|
||||||
|
pycparser 3.0
|
||||||
|
pydantic 2.12.5
|
||||||
|
pydantic_core 2.41.5
|
||||||
|
pyee 13.0.1
|
||||||
|
Pygments 2.19.2
|
||||||
|
pyotp 2.9.0
|
||||||
|
PySocks 1.7.1
|
||||||
|
python-dateutil 2.9.0.post0
|
||||||
|
python-magic 0.4.27
|
||||||
|
pytz 2026.1.post1
|
||||||
|
regex 2026.2.28
|
||||||
|
requests 2.32.5
|
||||||
|
rich 14.3.3
|
||||||
|
selenium 4.41.0
|
||||||
|
setuptools 82.0.1
|
||||||
|
shellingham 1.5.4
|
||||||
|
six 1.17.0
|
||||||
|
smart_open 7.5.1
|
||||||
|
sniffio 1.3.1
|
||||||
|
sortedcontainers 2.4.0
|
||||||
|
soupsieve 2.8.3
|
||||||
|
spacy 3.8.11
|
||||||
|
spacy-legacy 3.0.12
|
||||||
|
spacy-loggers 1.0.5
|
||||||
|
srsly 2.5.2
|
||||||
|
textblob 0.19.0
|
||||||
|
thinc 8.3.10
|
||||||
|
tqdm 4.67.3
|
||||||
|
trio 0.33.0
|
||||||
|
trio-websocket 0.12.2
|
||||||
|
tweety 0.1.6
|
||||||
|
tweety-ns 2.4.1
|
||||||
|
twscrape 0.17.0
|
||||||
|
typer 0.24.1
|
||||||
|
typer-slim 0.24.0
|
||||||
|
typing_extensions 4.15.0
|
||||||
|
typing-inspection 0.4.2
|
||||||
|
tzdata 2025.3
|
||||||
|
urllib3 2.6.3
|
||||||
|
vaderSentiment 3.3.2
|
||||||
|
wasabi 1.1.3
|
||||||
|
weasel 0.4.3
|
||||||
|
websocket-client 1.9.0
|
||||||
|
websockets 15.0.1
|
||||||
|
wrapt 2.1.2
|
||||||
|
wsproto 1.3.2
|
||||||
227
rss2bsky.py
Normal file
227
rss2bsky.py
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
import argparse
|
||||||
|
import arrow
|
||||||
|
import fastfeedparser
|
||||||
|
import logging
|
||||||
|
import re
|
||||||
|
import httpx
|
||||||
|
import time
|
||||||
|
import charset_normalizer # Per detectar la codificació del feed
|
||||||
|
import sys # Afegit per enviar els logs a la pantalla
|
||||||
|
from atproto import Client, client_utils, models
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
|
import html # Per desescapar entitats HTML
|
||||||
|
|
||||||
|
# --- Logging ---
|
||||||
|
# Ara envia els registres a la pantalla (stdout) en lloc d'un fitxer
|
||||||
|
logging.basicConfig(
|
||||||
|
format="%(asctime)s %(message)s",
|
||||||
|
level=logging.INFO, # Nivell DEBUG per veure més detalls durant el test
|
||||||
|
stream=sys.stdout
|
||||||
|
)
|
||||||
|
|
||||||
|
# --- Funció per corregir problemes de codificació ---
|
||||||
|
def fix_encoding(text):
|
||||||
|
try:
|
||||||
|
# Intenta decodificar i reencodificar a UTF-8
|
||||||
|
return text.encode("latin-1").decode("utf-8")
|
||||||
|
except (UnicodeEncodeError, UnicodeDecodeError):
|
||||||
|
logging.warning(f"Error corregint codificació: {text}")
|
||||||
|
return text # Retorna el text original si hi ha un error
|
||||||
|
|
||||||
|
# --- Funció per desescapar caràcters unicode ---
|
||||||
|
def desescapar_unicode(text):
|
||||||
|
try:
|
||||||
|
return html.unescape(text) # Utilitza html.unescape per gestionar HTML entities
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning(f"Error desescapant unicode: {e}")
|
||||||
|
return text # Retorna el text original si hi ha un error
|
||||||
|
|
||||||
|
# --- Funció per processar el títol ---
|
||||||
|
def process_title(title):
|
||||||
|
try:
|
||||||
|
if is_html(title):
|
||||||
|
title_text = BeautifulSoup(title, "html.parser", from_encoding="utf-8").get_text().strip()
|
||||||
|
else:
|
||||||
|
title_text = title.strip()
|
||||||
|
title_text = desescapar_unicode(title_text) # Desescapar HTML entities
|
||||||
|
title_text = fix_encoding(title_text) # Corregir problemes de codificació
|
||||||
|
return title_text
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning(f"Error processant el títol: {e}")
|
||||||
|
return title
|
||||||
|
|
||||||
|
def fetch_link_metadata(url):
|
||||||
|
try:
|
||||||
|
r = httpx.get(url, timeout=10)
|
||||||
|
r.raise_for_status()
|
||||||
|
soup = BeautifulSoup(r.text, "html.parser")
|
||||||
|
title = (soup.find("meta", property="og:title") or soup.find("title"))
|
||||||
|
desc = (soup.find("meta", property="og:description") or soup.find("meta", attrs={"name": "description"}))
|
||||||
|
image = (soup.find("meta", property="og:image") or soup.find("meta", attrs={"name": "twitter:image"}))
|
||||||
|
return {
|
||||||
|
"title": title["content"] if title and title.has_attr("content") else (title.text if title else ""),
|
||||||
|
"description": desc["content"] if desc and desc.has_attr("content") else "",
|
||||||
|
"image": image["content"] if image and image.has_attr("content") else None,
|
||||||
|
}
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning(f"Could not fetch link metadata for {url}: {e}")
|
||||||
|
return {}
|
||||||
|
|
||||||
|
def get_last_bsky(client, handle):
|
||||||
|
timeline = client.get_author_feed(handle)
|
||||||
|
for titem in timeline.feed:
|
||||||
|
# Only care about top-level, non-reply posts
|
||||||
|
if titem.reason is None and getattr(titem.post.record, "reply", None) is None:
|
||||||
|
logging.info("Record created %s", str(titem.post.record.created_at))
|
||||||
|
return arrow.get(titem.post.record.created_at)
|
||||||
|
return arrow.get(0)
|
||||||
|
|
||||||
|
def make_rich(content):
|
||||||
|
text_builder = client_utils.TextBuilder()
|
||||||
|
lines = content.split("\n")
|
||||||
|
for line in lines:
|
||||||
|
# If the line is a URL, make it a clickable link
|
||||||
|
if line.startswith("http"):
|
||||||
|
url = line.strip()
|
||||||
|
text_builder.link(url, url)
|
||||||
|
else:
|
||||||
|
tag_split = re.split("(#[a-zA-Z0-9]+)", line)
|
||||||
|
for i, t in enumerate(tag_split):
|
||||||
|
if i == len(tag_split) - 1:
|
||||||
|
t = t + "\n"
|
||||||
|
if t.startswith("#"):
|
||||||
|
text_builder.tag(t, t[1:].strip())
|
||||||
|
else:
|
||||||
|
text_builder.text(t)
|
||||||
|
return text_builder
|
||||||
|
|
||||||
|
# --- Nova funció: Només retorna el 'blob' necessari per a la miniatura de l'enllaç ---
|
||||||
|
def get_blob_from_url(image_url, client):
|
||||||
|
try:
|
||||||
|
r = httpx.get(image_url, timeout=10)
|
||||||
|
if r.status_code != 200:
|
||||||
|
return None
|
||||||
|
img_blob = client.upload_blob(r.content)
|
||||||
|
return img_blob.blob
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning(f"Could not fetch/upload image from {image_url}: {e}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
def is_html(text):
|
||||||
|
return bool(re.search(r'<.*?>', text))
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# --- Parse command-line arguments ---
|
||||||
|
parser = argparse.ArgumentParser(description="Post RSS to Bluesky.")
|
||||||
|
parser.add_argument("rss_feed", help="RSS feed URL")
|
||||||
|
parser.add_argument("bsky_handle", help="Bluesky handle")
|
||||||
|
parser.add_argument("bsky_username", help="Bluesky username")
|
||||||
|
parser.add_argument("bsky_app_password", help="Bluesky app password")
|
||||||
|
parser.add_argument("--service", default="https://bsky.social", help="Bluesky server URL (default: https://bsky.social)")
|
||||||
|
# Nova opció per a l'idioma, per defecte en català ('ca')
|
||||||
|
parser.add_argument("--lang", default="ca", help="Language code for the post (default: ca)")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
feed_url = args.rss_feed
|
||||||
|
bsky_handle = args.bsky_handle
|
||||||
|
bsky_username = args.bsky_username
|
||||||
|
bsky_password = args.bsky_app_password
|
||||||
|
service_url = args.service
|
||||||
|
post_lang = args.lang
|
||||||
|
|
||||||
|
# --- Login ---
|
||||||
|
client = Client(base_url=service_url) # Inicialitzem directament amb el servidor personalitzat
|
||||||
|
|
||||||
|
backoff = 60
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
logging.info(f"Attempting login to server: {service_url} with user: {bsky_username}")
|
||||||
|
client.login(bsky_username, bsky_password)
|
||||||
|
logging.info(f"Login successful for user: {bsky_username}")
|
||||||
|
break
|
||||||
|
except Exception as e:
|
||||||
|
logging.exception("Login exception")
|
||||||
|
time.sleep(backoff)
|
||||||
|
backoff = min(backoff + 60, 600)
|
||||||
|
|
||||||
|
# --- Get last Bluesky post time ---
|
||||||
|
last_bsky = get_last_bsky(client, bsky_handle)
|
||||||
|
|
||||||
|
# --- Parse feed ---
|
||||||
|
response = httpx.get(feed_url)
|
||||||
|
response.raise_for_status() # Comprova que la resposta sigui correcta
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Detecta automàticament la codificació i converteix a UTF-8
|
||||||
|
result = charset_normalizer.from_bytes(response.content).best()
|
||||||
|
if not result or not hasattr(result, "text"):
|
||||||
|
raise ValueError("No s'ha pogut detectar la codificació del feed o el text no és accessible.")
|
||||||
|
feed_content = result.text # Contingut decodificat com UTF-8
|
||||||
|
except ValueError:
|
||||||
|
logging.warning("No s'ha pogut detectar la codificació amb charset_normalizer. Provant amb latin-1.")
|
||||||
|
try:
|
||||||
|
feed_content = response.content.decode("latin-1")
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
logging.warning("No s'ha pogut decodificar amb latin-1. Provant amb utf-8 amb errors ignorats.")
|
||||||
|
feed_content = response.content.decode("utf-8", errors="ignore")
|
||||||
|
|
||||||
|
feed = fastfeedparser.parse(feed_content) # Passa el contingut decodificat al parser
|
||||||
|
|
||||||
|
# --- Inicialitzem el comptador d'entrades publicades ---
|
||||||
|
noves_entrades = 0
|
||||||
|
|
||||||
|
for item in feed.entries:
|
||||||
|
rss_time = arrow.get(item.published)
|
||||||
|
logging.info("RSS Time: %s", str(rss_time))
|
||||||
|
# Processar el títol per evitar problemes de codificació
|
||||||
|
title_text = process_title(item.title)
|
||||||
|
|
||||||
|
post_text = f"{title_text}\n{item.link}"
|
||||||
|
logging.info("Title+link used as content: %s", post_text)
|
||||||
|
rich_text = make_rich(post_text)
|
||||||
|
logging.info("Rich text length: %d" % (len(rich_text.build_text())))
|
||||||
|
logging.info("Filtered Content length: %d" % (len(post_text)))
|
||||||
|
|
||||||
|
# Si el RSS és més nou que l'últim post, publica
|
||||||
|
if rss_time > last_bsky:
|
||||||
|
link_metadata = fetch_link_metadata(item.link)
|
||||||
|
|
||||||
|
# --- 1. Obtenim el blob de la imatge per a la miniatura ---
|
||||||
|
thumb_blob = None
|
||||||
|
if link_metadata.get("image"):
|
||||||
|
thumb_blob = get_blob_from_url(link_metadata["image"], client)
|
||||||
|
|
||||||
|
# --- 2. Creem l'embed extern (targeta d'enllaç) i hi assignem la miniatura ---
|
||||||
|
embed = None
|
||||||
|
if link_metadata.get("title") or link_metadata.get("description") or thumb_blob:
|
||||||
|
embed = models.AppBskyEmbedExternal.Main(
|
||||||
|
external=models.AppBskyEmbedExternal.External(
|
||||||
|
uri=item.link,
|
||||||
|
title=link_metadata.get("title") or title_text or "Enllaç",
|
||||||
|
description=link_metadata.get("description") or "",
|
||||||
|
thumb=thumb_blob, # Aquí carreguem la imatge a la targeta
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
logging.info("Test mode: Preparing to send post %s" % (item.link))
|
||||||
|
# Afegim langs=[post_lang] per especificar l'idioma
|
||||||
|
client.send_post(rich_text, embed=embed, langs=[post_lang])
|
||||||
|
logging.info("Test mode: Post prepared %s" % (item.link))
|
||||||
|
|
||||||
|
# Incrementem el comptador d'èxits
|
||||||
|
noves_entrades += 1
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logging.exception("Failed to prepare post %s" % (item.link))
|
||||||
|
else:
|
||||||
|
logging.debug("Not sending %s" % (item.link))
|
||||||
|
|
||||||
|
# --- Resum final de l'execució ---
|
||||||
|
if noves_entrades > 0:
|
||||||
|
logging.info(f"🎉 Execució finalitzada: S'han publicat {noves_entrades} noves entrades a Bluesky.")
|
||||||
|
else:
|
||||||
|
logging.info("ℹ️ Execució finalitzada: No hi havia cap entrada nova per publicar.")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
76
sync_runner.sh
Executable file
76
sync_runner.sh
Executable file
@@ -0,0 +1,76 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit immediately if a command fails (except when we explicitly allow it later)
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "🚀 Starting Twitter to Bluesky Sync Job..."
|
||||||
|
|
||||||
|
# 1. Navigate to the directory containing the script
|
||||||
|
# (Uncomment and change the path below if running via cron so it knows where to look)
|
||||||
|
# cd /path/to/your/meteocatrss2bsky || exit
|
||||||
|
|
||||||
|
# 2. Load environment variables (Mimicking GitHub Secrets)
|
||||||
|
if [ -f ".env" ]; then
|
||||||
|
echo "📂 Loading secrets from .env file..."
|
||||||
|
export $(grep -v '^#' .env | xargs)
|
||||||
|
else
|
||||||
|
echo "⚠️ No .env file found. Make sure environment variables are exported manually!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Set up Python Virtual Environment (Mimicking actions/setup-python)
|
||||||
|
if [ ! -d "venv" ]; then
|
||||||
|
echo "🐍 Creating Python virtual environment..."
|
||||||
|
python3 -m venv venv
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "🔄 Activating virtual environment..."
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
# 4. Install dependencies
|
||||||
|
echo "📦 Installing dependencies..."
|
||||||
|
pip install --upgrade pip -q
|
||||||
|
pip install atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
|
||||||
|
# Install the browser
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
# Install the required Linux system libraries
|
||||||
|
playwright install-deps chromium
|
||||||
|
|
||||||
|
# 5. Run the script
|
||||||
|
echo "▶️ Running the sync script..."
|
||||||
|
|
||||||
|
# Temporarily disable "exit on error" so we can catch a script crash and save the screenshot
|
||||||
|
set +e
|
||||||
|
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username "$TWITTER_USERNAME" \
|
||||||
|
--twitter-password "$TWITTER_PASSWORD" \
|
||||||
|
--twitter-email "$TWITTER_EMAIL" \
|
||||||
|
--twitter-handle "$TWITTER_HANDLE" \
|
||||||
|
--bsky-handle "$BSKY_HANDLE" \
|
||||||
|
--bsky-password "$BSKY_APP_PASSWORD"
|
||||||
|
|
||||||
|
EXIT_CODE=$?
|
||||||
|
|
||||||
|
# Re-enable "exit on error"
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# 6. Handle Errors and Screenshots (Mimicking actions/upload-artifact)
|
||||||
|
if [ $EXIT_CODE -ne 0 ]; then
|
||||||
|
echo "❌ Script failed with exit code $EXIT_CODE."
|
||||||
|
|
||||||
|
# Check if any screenshots were generated by Playwright
|
||||||
|
if ls screenshot_*.png 1> /dev/null 2>&1; then
|
||||||
|
echo "📸 Error screenshots found. Moving them to 'error_artifacts' folder..."
|
||||||
|
mkdir -p error_artifacts
|
||||||
|
mv screenshot_*.png error_artifacts/
|
||||||
|
echo "✅ Screenshots saved in ./error_artifacts/"
|
||||||
|
else
|
||||||
|
echo "⚠️ No screenshots found."
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $EXIT_CODE
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✅ Sync job completed successfully!"
|
||||||
46
testlogin.py
Normal file
46
testlogin.py
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import argparse
|
||||||
|
import logging
|
||||||
|
import time
|
||||||
|
from atproto import Client
|
||||||
|
|
||||||
|
# --- Logging ---
|
||||||
|
LOG_PATH = "rss2bsky_test.log"
|
||||||
|
logging.basicConfig(
|
||||||
|
format="%(asctime)s %(message)s",
|
||||||
|
filename=LOG_PATH,
|
||||||
|
encoding="utf-8",
|
||||||
|
level=logging.INFO,
|
||||||
|
)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# --- Parse command-line arguments ---
|
||||||
|
parser = argparse.ArgumentParser(description="Post RSS to Bluesky.")
|
||||||
|
parser.add_argument("rss_feed", help="RSS feed URL")
|
||||||
|
parser.add_argument("bsky_handle", help="Bluesky handle")
|
||||||
|
parser.add_argument("bsky_username", help="Bluesky username")
|
||||||
|
parser.add_argument("bsky_app_password", help="Bluesky app password")
|
||||||
|
parser.add_argument("--service", default="https://bsky.social", help="Bluesky server URL (default: https://bsky.social)")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
bsky_username = args.bsky_username
|
||||||
|
bsky_password = args.bsky_app_password
|
||||||
|
service_url = args.service
|
||||||
|
|
||||||
|
# --- Login ---
|
||||||
|
# SOLUCIÓ: Passem el base_url directament al constructor del Client
|
||||||
|
client = Client(base_url=service_url)
|
||||||
|
|
||||||
|
backoff = 60
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
logging.info(f"Attempting login to server: {service_url} with user: {bsky_username}")
|
||||||
|
client.login(bsky_username, bsky_password)
|
||||||
|
logging.info(f"Login successful for user: {bsky_username}")
|
||||||
|
break
|
||||||
|
except Exception as e:
|
||||||
|
logging.exception("Login exception")
|
||||||
|
time.sleep(backoff)
|
||||||
|
backoff = min(backoff + 60, 600)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
420
twitter2bsky_daemon.py
Normal file
420
twitter2bsky_daemon.py
Normal file
@@ -0,0 +1,420 @@
|
|||||||
|
import argparse
|
||||||
|
import arrow
|
||||||
|
import logging
|
||||||
|
import re
|
||||||
|
import httpx
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
from atproto import Client, client_utils, models
|
||||||
|
from playwright.sync_api import sync_playwright
|
||||||
|
|
||||||
|
# --- Logging Setup ---
|
||||||
|
LOG_PATH = "twitter2bsky.log"
|
||||||
|
logging.basicConfig(
|
||||||
|
format="%(asctime)s [%(levelname)s] %(message)s",
|
||||||
|
handlers=[logging.FileHandler(LOG_PATH, encoding="utf-8"), logging.StreamHandler()],
|
||||||
|
level=logging.INFO,
|
||||||
|
)
|
||||||
|
|
||||||
|
# --- Custom Classes to replace Tweety ---
|
||||||
|
class ScrapedMedia:
|
||||||
|
def __init__(self, url):
|
||||||
|
self.type = "photo"
|
||||||
|
self.media_url_https = url
|
||||||
|
|
||||||
|
class ScrapedTweet:
|
||||||
|
def __init__(self, created_on, text, media_urls):
|
||||||
|
self.created_on = created_on
|
||||||
|
self.text = text
|
||||||
|
self.media = [ScrapedMedia(url) for url in media_urls]
|
||||||
|
|
||||||
|
# --- 1. Playwright Scraping Logic ---
|
||||||
|
def take_error_screenshot(page, error_msg):
|
||||||
|
logging.info(f"📸 Taking screenshot... Shot: {error_msg}")
|
||||||
|
timestamp = time.strftime("%Y%m%d_%H%M%S")
|
||||||
|
screenshot_name = f"screenshot_{timestamp}.png"
|
||||||
|
page.screenshot(path=screenshot_name)
|
||||||
|
logging.info(f"📸 Screenshot saved as: {screenshot_name}")
|
||||||
|
|
||||||
|
def scrape_tweets_via_playwright(username, password, email, target_handle):
|
||||||
|
"""Logs in (or loads session) and scrapes tweets directly from the DOM."""
|
||||||
|
tweets = []
|
||||||
|
state_file = "twitter_browser_state.json"
|
||||||
|
|
||||||
|
with sync_playwright() as p:
|
||||||
|
browser = p.chromium.launch(headless=True, args=["--disable-blink-features=AutomationControlled"])
|
||||||
|
clean_ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.7632.6 Safari/537.36"
|
||||||
|
|
||||||
|
context = None
|
||||||
|
needs_login = True
|
||||||
|
|
||||||
|
# 1. Try to load existing session
|
||||||
|
if os.path.exists(state_file):
|
||||||
|
logging.info("✅ Found existing browser state. Attempting to bypass login...")
|
||||||
|
context = browser.new_context(
|
||||||
|
user_agent=clean_ua,
|
||||||
|
viewport={'width': 1920, 'height': 1080},
|
||||||
|
storage_state=state_file
|
||||||
|
)
|
||||||
|
page = context.new_page()
|
||||||
|
page.goto("https://x.com/home")
|
||||||
|
time.sleep(4)
|
||||||
|
|
||||||
|
# Check if we are actually logged in
|
||||||
|
if page.locator('[data-testid="SideNav_NewTweet_Button"]').is_visible() or "/home" in page.url:
|
||||||
|
logging.info("✅ Session is valid!")
|
||||||
|
needs_login = False
|
||||||
|
else:
|
||||||
|
logging.warning("⚠️ Saved session expired or invalid. Re-logging in...")
|
||||||
|
context.close()
|
||||||
|
os.remove(state_file)
|
||||||
|
|
||||||
|
# 2. Perform Login if needed
|
||||||
|
if needs_login:
|
||||||
|
logging.info("🚀 Launching fresh browser for automated Twitter login...")
|
||||||
|
context = browser.new_context(
|
||||||
|
user_agent=clean_ua,
|
||||||
|
viewport={'width': 1920, 'height': 1080}
|
||||||
|
)
|
||||||
|
page = context.new_page()
|
||||||
|
|
||||||
|
try:
|
||||||
|
page.goto("https://x.com")
|
||||||
|
sign_in_button = page.get_by_text("Sign in", exact=True)
|
||||||
|
sign_in_button.wait_for(state="visible", timeout=15000)
|
||||||
|
sign_in_button.click(force=True)
|
||||||
|
|
||||||
|
page.wait_for_selector('h1:has-text("Sign in to X")', state='visible', timeout=25000)
|
||||||
|
logging.info(f"👤 Entering username: {username}...")
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
username_input = page.locator('input[autocomplete="username"]')
|
||||||
|
username_input.wait_for(state="visible", timeout=15000)
|
||||||
|
username_input.click(force=True)
|
||||||
|
username_input.press_sequentially(username, delay=100)
|
||||||
|
|
||||||
|
page.locator('button:has-text("Next")').first.click(force=True)
|
||||||
|
page.wait_for_selector('input[name="password"], input[data-testid="ocfEnterTextTextInput"], input[name="text"]', timeout=15000)
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
if page.locator('input[data-testid="ocfEnterTextTextInput"]').is_visible() or page.locator('input[name="text"]').is_visible():
|
||||||
|
logging.warning("🛡️ Security challenge detected! Entering email/phone...")
|
||||||
|
page.fill('input[data-testid="ocfEnterTextTextInput"], input[name="text"]', email)
|
||||||
|
sec_next = page.locator('[data-testid="ocfEnterTextNextButton"], span:has-text("Next")').first
|
||||||
|
if sec_next.is_visible():
|
||||||
|
sec_next.click(force=True)
|
||||||
|
else:
|
||||||
|
page.keyboard.press("Enter")
|
||||||
|
page.wait_for_selector('input[name="password"]', timeout=15000)
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
logging.info("🔑 Entering password...")
|
||||||
|
page.fill('input[name="password"]', password)
|
||||||
|
page.locator('span:has-text("Log in")').first.click()
|
||||||
|
|
||||||
|
page.wait_for_url("**/home", timeout=20000)
|
||||||
|
time.sleep(3)
|
||||||
|
|
||||||
|
# Save state for next time
|
||||||
|
context.storage_state(path=state_file)
|
||||||
|
logging.info("✅ Login successful. Browser state saved.")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
take_error_screenshot(page, "login_failed")
|
||||||
|
logging.error(f"❌ Login failed: {e}")
|
||||||
|
browser.close()
|
||||||
|
return []
|
||||||
|
|
||||||
|
# 3. Scrape the target profile
|
||||||
|
logging.info(f"🌐 Navigating to https://x.com/{target_handle} to scrape tweets...")
|
||||||
|
page.goto(f"https://x.com/{target_handle}")
|
||||||
|
|
||||||
|
try:
|
||||||
|
page.wait_for_selector('article', timeout=20000)
|
||||||
|
time.sleep(3) # Let DOM settle and images load
|
||||||
|
|
||||||
|
articles = page.locator('article').all()
|
||||||
|
logging.info(f"📊 Found {len(articles)} tweets on screen. Parsing...")
|
||||||
|
|
||||||
|
for article in articles[:10]: # Check top 10 tweets
|
||||||
|
try:
|
||||||
|
# Get Time
|
||||||
|
time_el = article.locator('time').first
|
||||||
|
if not time_el.is_visible():
|
||||||
|
continue # Skip ads or invalid articles
|
||||||
|
created_at = time_el.get_attribute('datetime')
|
||||||
|
|
||||||
|
# Get Text
|
||||||
|
text_locator = article.locator('[data-testid="tweetText"]')
|
||||||
|
text = text_locator.inner_text() if text_locator.is_visible() else ""
|
||||||
|
|
||||||
|
# Get Images
|
||||||
|
image_urls = []
|
||||||
|
photo_locators = article.locator('[data-testid="tweetPhoto"] img').all()
|
||||||
|
for img in photo_locators:
|
||||||
|
src = img.get_attribute('src')
|
||||||
|
if src:
|
||||||
|
# Convert thumbnail URL to high-res URL
|
||||||
|
src = re.sub(r'&name=\w+', '&name=large', src)
|
||||||
|
image_urls.append(src)
|
||||||
|
|
||||||
|
tweets.append(ScrapedTweet(created_at, text, image_urls))
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning(f"⚠️ Failed to parse a specific tweet: {e}")
|
||||||
|
continue
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
take_error_screenshot(page, "scrape_failed")
|
||||||
|
logging.error(f"❌ Failed to scrape profile: {e}")
|
||||||
|
|
||||||
|
browser.close()
|
||||||
|
return tweets
|
||||||
|
|
||||||
|
# --- 2. URL Validation Function ---
|
||||||
|
def is_valid_url(url):
|
||||||
|
try:
|
||||||
|
# Follow redirects and accept standard anti-bot codes (like 403) so we don't discard real news links
|
||||||
|
response = httpx.head(url, timeout=5, follow_redirects=True)
|
||||||
|
return response.status_code < 500
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
|
# --- 3. URL Cleaning Function ---
|
||||||
|
def clean_url(url):
|
||||||
|
trimmed_url = url.strip()
|
||||||
|
cleaned_url = re.sub(r'\s+', '', trimmed_url)
|
||||||
|
|
||||||
|
# Strip trailing ellipsis (unicode '…' or ascii '...') and trailing periods
|
||||||
|
cleaned_url = re.sub(r'[…\.]+$', '', cleaned_url)
|
||||||
|
|
||||||
|
if is_valid_url(cleaned_url):
|
||||||
|
return cleaned_url
|
||||||
|
return None
|
||||||
|
|
||||||
|
# --- 4. Formatting & Bluesky Logic ---
|
||||||
|
def get_last_bsky(client, handle):
|
||||||
|
timeline = client.get_author_feed(handle)
|
||||||
|
for titem in timeline.feed:
|
||||||
|
if titem.reason is None and getattr(titem.post.record, "reply", None) is None:
|
||||||
|
return arrow.get(titem.post.record.created_at)
|
||||||
|
return arrow.get(0)
|
||||||
|
|
||||||
|
def make_rich(content):
|
||||||
|
text_builder = client_utils.TextBuilder()
|
||||||
|
|
||||||
|
# 1. Smart URL Repair: Find URLs broken by newlines and glue them back together
|
||||||
|
def repair_url(match):
|
||||||
|
raw = match.group(0)
|
||||||
|
|
||||||
|
# If there are no newlines, just strip trailing ellipsis and return
|
||||||
|
if '\n' not in raw and '\r' not in raw:
|
||||||
|
return re.sub(r'[…\.]+$', '', raw)
|
||||||
|
|
||||||
|
# Try removing all newlines
|
||||||
|
glued = raw.replace('\n', '').replace('\r', '')
|
||||||
|
|
||||||
|
# Strip trailing ellipsis for validation
|
||||||
|
test_url = re.sub(r'[…\.]+$', '', glued)
|
||||||
|
|
||||||
|
# If gluing it creates a valid URL, it was definitely broken by Twitter's DOM
|
||||||
|
if is_valid_url(test_url):
|
||||||
|
return test_url
|
||||||
|
|
||||||
|
# If it's NOT a valid URL, maybe the newline was supposed to be there (e.g., URL\nNextParagraph)
|
||||||
|
parts = raw.split('\n')
|
||||||
|
test_part0 = re.sub(r'[…\.]+$', '', parts[0])
|
||||||
|
if is_valid_url(test_part0):
|
||||||
|
return raw # Return original to preserve the paragraph break
|
||||||
|
|
||||||
|
# Fallback: assume it's a broken URL and glue it anyway
|
||||||
|
return test_url
|
||||||
|
|
||||||
|
# This regex grabs http:// or https:// followed by any non-space characters (including newlines)
|
||||||
|
content = re.sub(r'https?://[^\ \t]+', repair_url, content.strip())
|
||||||
|
|
||||||
|
# 2. Split content into lines to preserve actual paragraph breaks
|
||||||
|
lines = content.splitlines()
|
||||||
|
|
||||||
|
for line_idx, line in enumerate(lines):
|
||||||
|
# Handle empty lines to preserve spacing
|
||||||
|
if not line.strip():
|
||||||
|
if line_idx < len(lines) - 1:
|
||||||
|
text_builder.text("\n")
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Split by space to process words, URLs, and tags
|
||||||
|
words = line.split(" ")
|
||||||
|
for i, word in enumerate(words):
|
||||||
|
if not word: # Handle double spaces gracefully
|
||||||
|
if i < len(words) - 1:
|
||||||
|
text_builder.text(" ")
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Check and convert URLs
|
||||||
|
if word.startswith("http://") or word.startswith("https://"):
|
||||||
|
# Ensure the URL is converted to https if it starts with http
|
||||||
|
if word.startswith("http://"):
|
||||||
|
word = word.replace("http://", "https://", 1)
|
||||||
|
|
||||||
|
# Strip trailing ellipsis right here so it doesn't fail validation
|
||||||
|
word = re.sub(r'[…\.]+$', '', word)
|
||||||
|
|
||||||
|
# Clean the URL further using the clean_url function
|
||||||
|
clean_url_value = clean_url(word)
|
||||||
|
if clean_url_value and is_valid_url(clean_url_value):
|
||||||
|
text_builder.link(clean_url_value, clean_url_value)
|
||||||
|
else:
|
||||||
|
text_builder.text(word) # Add as plain text if invalid
|
||||||
|
elif word.startswith("#"):
|
||||||
|
clean_tag = word[1:].rstrip(".,;:!?)'\"…")
|
||||||
|
text_builder.tag(word, clean_tag)
|
||||||
|
else:
|
||||||
|
text_builder.text(word)
|
||||||
|
|
||||||
|
if i < len(words) - 1:
|
||||||
|
text_builder.text(" ") # Add space between words
|
||||||
|
|
||||||
|
# Add a line break after each processed line, except the very last one
|
||||||
|
if line_idx < len(lines) - 1:
|
||||||
|
text_builder.text("\n")
|
||||||
|
|
||||||
|
return text_builder
|
||||||
|
|
||||||
|
def get_blob_from_url(image_url, client):
|
||||||
|
try:
|
||||||
|
r = httpx.get(image_url, timeout=10)
|
||||||
|
if r.status_code == 200:
|
||||||
|
return client.upload_blob(r.content).blob
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning(f"Could not fetch image {image_url}: {e}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
# --- 5. Main Sync Function ---
|
||||||
|
def sync_feeds(args):
|
||||||
|
logging.info("🔄 Starting sync cycle...")
|
||||||
|
try:
|
||||||
|
# 1. Fetch Tweets via Playwright
|
||||||
|
tweets = scrape_tweets_via_playwright(
|
||||||
|
args.twitter_username,
|
||||||
|
args.twitter_password,
|
||||||
|
args.twitter_email,
|
||||||
|
args.twitter_handle
|
||||||
|
)
|
||||||
|
|
||||||
|
if not tweets:
|
||||||
|
logging.warning("⚠️ No tweets found or failed to fetch. Skipping Bluesky sync for this cycle.")
|
||||||
|
return
|
||||||
|
|
||||||
|
# 2. Connect to Bluesky
|
||||||
|
bsky_client = Client()
|
||||||
|
bsky_client.login(args.bsky_handle, args.bsky_password)
|
||||||
|
last_bsky_time = get_last_bsky(bsky_client, args.bsky_handle)
|
||||||
|
|
||||||
|
# 3. Process and Post
|
||||||
|
new_posts = 0
|
||||||
|
|
||||||
|
for tweet in reversed(tweets):
|
||||||
|
tweet_time = arrow.get(tweet.created_on)
|
||||||
|
|
||||||
|
if tweet_time > last_bsky_time: # Only post new tweets
|
||||||
|
#if True: # For testing, post all tweets regardless of time
|
||||||
|
logging.info(f"📝 Found new tweet from {tweet_time}. Posting to Bluesky...")
|
||||||
|
|
||||||
|
raw_text = tweet.text.strip()
|
||||||
|
|
||||||
|
# Smart truncation: Don't cut off in the middle of a word/URL
|
||||||
|
if len(raw_text) > 295:
|
||||||
|
truncated = raw_text[:290]
|
||||||
|
last_space = truncated.rfind(" ")
|
||||||
|
if last_space > 0:
|
||||||
|
raw_text = truncated[:last_space] + "..."
|
||||||
|
else:
|
||||||
|
raw_text = truncated + "..."
|
||||||
|
logging.info("✂️ Tweet exceeded 300 characters. Truncated safely for Bluesky.")
|
||||||
|
|
||||||
|
# Generate rich_text (This is now a TextBuilder object)
|
||||||
|
rich_text = make_rich(raw_text)
|
||||||
|
|
||||||
|
images = []
|
||||||
|
if tweet.media:
|
||||||
|
# --- NEW: Generate dynamic alt text based on the tweet content ---
|
||||||
|
# 1. Remove line breaks and extra spaces
|
||||||
|
dynamic_alt = raw_text.replace('\n', ' ').strip()
|
||||||
|
# 2. Remove URLs to keep the text clean
|
||||||
|
dynamic_alt = re.sub(r'https?://\S+', '', dynamic_alt).strip()
|
||||||
|
|
||||||
|
# 3. Truncate gracefully if it's too long
|
||||||
|
if len(dynamic_alt) > 150:
|
||||||
|
dynamic_alt = dynamic_alt[:147] + "..."
|
||||||
|
elif not dynamic_alt:
|
||||||
|
# Fallback if the tweet is literally just an image with no text
|
||||||
|
dynamic_alt = "Imatge adjunta al tuit"
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
|
for media in tweet.media:
|
||||||
|
if media.type == "photo":
|
||||||
|
blob = get_blob_from_url(media.media_url_https, bsky_client)
|
||||||
|
if blob:
|
||||||
|
# Inject our dynamic alt text here!
|
||||||
|
images.append(models.AppBskyEmbedImages.Image(alt=dynamic_alt, image=blob))
|
||||||
|
|
||||||
|
# 🌐 Posting with Catalan language tag
|
||||||
|
try:
|
||||||
|
if images:
|
||||||
|
embed = models.AppBskyEmbedImages.Main(images=images)
|
||||||
|
bsky_client.send_post(text=rich_text, embed=embed, langs=["ca"])
|
||||||
|
else:
|
||||||
|
bsky_client.send_post(text=rich_text, langs=["ca"])
|
||||||
|
|
||||||
|
new_posts += 1
|
||||||
|
logging.info(f"✅ Posted new tweet to Bluesky: {raw_text}")
|
||||||
|
time.sleep(5) # Rate limit handling
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(f"❌ Failed to post tweet to Bluesky: {e}")
|
||||||
|
|
||||||
|
logging.info(f"✅ Sync complete. Posted {new_posts} new updates.")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logging.error(f"❌ Error during sync cycle: {e}")
|
||||||
|
|
||||||
|
# --- 6. Main Execution ---
|
||||||
|
def main():
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description="Twitter to Bluesky Sync")
|
||||||
|
|
||||||
|
parser.add_argument("--twitter-username", help="Your Twitter login username")
|
||||||
|
parser.add_argument("--twitter-password", help="Your Twitter login password")
|
||||||
|
parser.add_argument("--twitter-email", help="Your Twitter email for security challenges")
|
||||||
|
parser.add_argument("--twitter-handle", help="The Twitter account to scrape")
|
||||||
|
parser.add_argument("--bsky-handle", help="Your Bluesky handle")
|
||||||
|
parser.add_argument("--bsky-password", help="Your Bluesky app password")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
args.twitter_username = args.twitter_username or os.getenv("TWITTER_USERNAME")
|
||||||
|
args.twitter_password = args.twitter_password or os.getenv("TWITTER_PASSWORD")
|
||||||
|
args.twitter_email = args.twitter_email or os.getenv("TWITTER_EMAIL")
|
||||||
|
args.bsky_handle = args.bsky_handle or os.getenv("BSKY_HANDLE")
|
||||||
|
args.bsky_password = args.bsky_password or os.getenv("BSKY_APP_PASSWORD")
|
||||||
|
|
||||||
|
args.twitter_handle = args.twitter_handle or os.getenv("TWITTER_HANDLE") or args.twitter_username
|
||||||
|
|
||||||
|
missing_args = []
|
||||||
|
if not args.twitter_username: missing_args.append("--twitter-username")
|
||||||
|
if not args.twitter_password: missing_args.append("--twitter-password")
|
||||||
|
if not args.bsky_handle: missing_args.append("--bsky-handle")
|
||||||
|
if not args.bsky_password: missing_args.append("--bsky-password")
|
||||||
|
|
||||||
|
if missing_args:
|
||||||
|
logging.error(f"❌ Missing credentials! You forgot to provide: {', '.join(missing_args)}")
|
||||||
|
return
|
||||||
|
|
||||||
|
logging.info(f"🤖 Bot started. Will check @{args.twitter_handle}")
|
||||||
|
sync_feeds(args)
|
||||||
|
logging.info(f"🤖 Bot finished.")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
1
twitter_browser_state.json
Normal file
1
twitter_browser_state.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"cookies": [{"name": "guest_id", "value": "v1%3A177400072785925132", "domain": ".x.com", "path": "/", "expires": 1808215127.902756, "httpOnly": false, "secure": true, "sameSite": "None"}, {"name": "__cf_bm", "value": "H7wdqjOsJxCl9dL6tlyGX9yuiPY6_MCag0wCtY1JDoY-1774000727.801313-1.0.1.1-VvacOcfUevB1X0Yk6UwbhE76SrO3RikDTfLMXZ0FgCr4U0LxoAOikq2skTgJg6x9H3GvMZbL1ZQ5hqFZ5E3W5YQfs5KuT0ULnhHJfwWEi1K5zAlinqg81US0m5o29dkb", "domain": ".x.com", "path": "/", "expires": 1774002527.90335, "httpOnly": true, "secure": true, "sameSite": "Lax"}, {"name": "gt", "value": "2034932659386790365", "domain": ".x.com", "path": "/", "expires": 1774009727.955248, "httpOnly": false, "secure": true, "sameSite": "Lax"}, {"name": "__cuid", "value": "e5d0ff1096be49d0961985c891888199", "domain": ".x.com", "path": "/", "expires": 1808557139, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "guest_id", "value": "v1%3A177400073231410330", "domain": ".twitter.com", "path": "/", "expires": 1808215132.347495, "httpOnly": false, "secure": true, "sameSite": "None"}, {"name": "g_state", "value": "{\"i_l\":0,\"i_ll\":1774000732872,\"i_b\":\"EyzAkH9CN25/pUHamsdhwuJAJBr1b7oLnIlP0mQoA+M\",\"i_e\":{\"enable_itp_optimization\":0}}", "domain": "x.com", "path": "/", "expires": 1789552732, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "kdt", "value": "xXlwtuw8pTQAj3PJWNNPsQ9FJAkDhXroQGzQ3krO", "domain": ".x.com", "path": "/", "expires": 1808215138.34135, "httpOnly": true, "secure": true, "sameSite": "Lax"}, {"name": "auth_token", "value": "e89ae2d30176bd6448e0d0f3414c3be8a093313a", "domain": ".x.com", "path": "/", "expires": 1808215138.341971, "httpOnly": true, "secure": true, "sameSite": "None"}, {"name": "ct0", "value": "3621f3424fd04ee9b5624d3424c83c85fcc22f1a9d9052774eb35c062d7b6978c2371c71dc59501895b76931ac6d42fe1268d571cd9dcd1a2e4ff29f1d313718d309aaaf016596dd3876acaf2fcf1953", "domain": ".x.com", "path": "/", "expires": 1808215138.542487, "httpOnly": false, "secure": true, "sameSite": "Lax"}, {"name": "att", "value": "1-8VAaFlF2foVMvl6ZoFklG1CgLuh3iK0zYTcgO9Sr", "domain": ".x.com", "path": "/", "expires": 1774087138.830533, "httpOnly": true, "secure": true, "sameSite": "None"}, {"name": "lang", "value": "en", "domain": "x.com", "path": "/", "expires": -1, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "twid", "value": "u%3D2032754376381706242", "domain": ".x.com", "path": "/", "expires": 1805536740.495044, "httpOnly": false, "secure": true, "sameSite": "None"}], "origins": [{"origin": "https://x.com", "localStorage": [{"name": "__cuid", "value": "e5d0ff1096be49d0961985c891888199"}]}]}
|
||||||
103
twitter_login.py
Normal file
103
twitter_login.py
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import argparse
|
||||||
|
from playwright.sync_api import sync_playwright
|
||||||
|
from tweety import Twitter
|
||||||
|
import time
|
||||||
|
|
||||||
|
def get_twitter_auth_token(username, password):
|
||||||
|
with sync_playwright() as p:
|
||||||
|
print("🚀 Launching headless browser...")
|
||||||
|
# Add arguments to bypass basic bot detection
|
||||||
|
browser = p.chromium.launch(headless=True, args=["--disable-blink-features=AutomationControlled"])
|
||||||
|
context = browser.new_context(
|
||||||
|
user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
||||||
|
)
|
||||||
|
page = context.new_page()
|
||||||
|
|
||||||
|
try:
|
||||||
|
print("🌐 Navigating to X login...")
|
||||||
|
page.goto("https://x.com/i/flow/login")
|
||||||
|
|
||||||
|
# 1. Fill with username
|
||||||
|
print(f"👤 Entering username: {username}...")
|
||||||
|
# Using the exact autocomplete attribute from your HTML
|
||||||
|
page.wait_for_selector('input[autocomplete="username"]', timeout=25000)
|
||||||
|
time.sleep(10) # Wait a bit for any potential animations or dynamic content to load
|
||||||
|
# CLICK ON THE INPUT BEFORE POPULATING THE USERNAME
|
||||||
|
page.click('input[autocomplete="username"]')
|
||||||
|
time.sleep(10)
|
||||||
|
page.fill('input[autocomplete="username"]', username)
|
||||||
|
|
||||||
|
# Enter and wait for the next screen
|
||||||
|
print("➡️ Pressing Enter to proceed...")
|
||||||
|
page.keyboard.press("Enter")
|
||||||
|
|
||||||
|
# Wait a moment for the screen transition animation
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
|
# 2. Fill with the password
|
||||||
|
print("🔑 Entering password...")
|
||||||
|
# Using the exact name attribute from your HTML
|
||||||
|
page.wait_for_selector('input[name="password"]', timeout=25000)
|
||||||
|
time.sleep(10) # Wait a bit for any potential animations or dynamic content to load
|
||||||
|
# CLICK ON THE INPUT BEFORE POPULATING THE PASSWORD
|
||||||
|
page.click('input[name="password"]')
|
||||||
|
page.fill('input[name="password"]', password)
|
||||||
|
|
||||||
|
# 3. Click on Login
|
||||||
|
print("🖱️ Clicking 'Log in'...")
|
||||||
|
# Targeting the exact span text you provided
|
||||||
|
page.locator('span:has-text("Log in")').first.click()
|
||||||
|
|
||||||
|
print("⏳ Waiting for login to complete...")
|
||||||
|
# Wait for the redirect to the home page
|
||||||
|
page.wait_for_url("**/home", timeout=25000)
|
||||||
|
|
||||||
|
# 4. Extract Cookies
|
||||||
|
cookies = context.cookies()
|
||||||
|
auth_token = None
|
||||||
|
for cookie in cookies:
|
||||||
|
if cookie['name'] == 'auth_token':
|
||||||
|
auth_token = cookie['value']
|
||||||
|
break
|
||||||
|
|
||||||
|
browser.close()
|
||||||
|
return auth_token
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
# IF IT FAILS, TAKE A SCREENSHOT!
|
||||||
|
print(f"❌ Error encountered. Taking a screenshot...")
|
||||||
|
page.screenshot(path="error_screenshot.png")
|
||||||
|
browser.close()
|
||||||
|
raise e
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# Set up argument parsing
|
||||||
|
parser = argparse.ArgumentParser(description="Automate Twitter login and save session token.")
|
||||||
|
parser.add_argument("username", help="Your Twitter username")
|
||||||
|
parser.add_argument("password", help="Your Twitter password")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Pass the arguments from the terminal to the function
|
||||||
|
token = get_twitter_auth_token(args.username, args.password)
|
||||||
|
|
||||||
|
if token:
|
||||||
|
print("🔑 Successfully extracted auth_token!")
|
||||||
|
|
||||||
|
# Initialize the tweety session file
|
||||||
|
app = Twitter("my_account_session")
|
||||||
|
|
||||||
|
print("💾 Saving session to tweety-ns...")
|
||||||
|
app.load_auth_token(token)
|
||||||
|
|
||||||
|
print("✅ Success! Your session has been saved.")
|
||||||
|
else:
|
||||||
|
print("❌ Failed to find auth_token cookie.")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"❌ An error occurred: {e}")
|
||||||
|
print("📸 Check the 'error_screenshot.png' file in your folder to see what X showed the bot!")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
23
workflows/324.yml
Normal file
23
workflows/324.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: 3CatInfo RSS to BSKY
|
||||||
|
description: "A GitHub Action to post 324 (now 3CatInfo) RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://api.3cat.cat/noticies\?_format\=rss\&origen\=frontal\&frontal\=n324-portada-noticia\&version\=2.0 ${{ secrets.BSKY_324_HANDLE }} ${{ secrets.BSKY_324_USERNAME }} ${{ secrets.BSKY_324_APP_PASSWORD }} --service "https://eurosky.social"
|
||||||
33
workflows/3cat.yml
Normal file
33
workflows/3cat.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post Som3CAT Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter Meteocat to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_3CAT_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_3CAT_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_3CAT_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_3CAT_APP_PASSWORD }}
|
||||||
33
workflows/bomberscat.yml
Normal file
33
workflows/bomberscat.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post BombersCat user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_CAT112_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_BOMBERSCAT_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_CAT112_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_CAT112_PASSWORD }}
|
||||||
33
workflows/crunchy.yml
Normal file
33
workflows/crunchy.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post Crunchyroll Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter Crunchyroll to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_CAT112_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_CRUNCHYROLL_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_CRUNCHYROLL_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_CRUNCHYROLL_APP_PASSWORD }}
|
||||||
23
workflows/crunchyroll.yml
Normal file
23
workflows/crunchyroll.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Crunchyroll Portada Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://cr-news-api-service.prd.crunchyrollsvc.com/v1/es-ES/rss ${{ secrets.BSKY_CRUNCHYROLL_HANDLE }} ${{ secrets.BSKY_CRUNCHYROLL_USERNAME }} ${{ secrets.BSKY_CRUNCHYROLL_APP_PASSWORD }}
|
||||||
33
workflows/emergenciescat.yml
Normal file
33
workflows/emergenciescat.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post EmergenciesCat user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_CAT112_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_EMERGENCIESCAT_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_CAT112_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_CAT112_PASSWORD }}
|
||||||
23
workflows/epc-badalona.yml
Normal file
23
workflows/epc-badalona.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Badalona Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/badalona/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-barcelona.yml
Normal file
23
workflows/epc-barcelona.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Barcelona Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/barcelona/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-ciencia.yml
Normal file
23
workflows/epc-ciencia.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Ciencia Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/ciencia/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-cornella.yml
Normal file
23
workflows/epc-cornella.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Cornellà Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/cornella/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-economia.yml
Normal file
23
workflows/epc-economia.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Economia Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/economia/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-educacio.yml
Normal file
23
workflows/epc-educacio.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Educació Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/educacio/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-esports.yml
Normal file
23
workflows/epc-esports.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Esports Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/esports/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-extra.yml
Normal file
23
workflows/epc-extra.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Extra Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/extra/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-gent.yml
Normal file
23
workflows/epc-gent.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Gent Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/gent/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-hospitalet.yml
Normal file
23
workflows/epc-hospitalet.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Hospitalet Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/hospitalet/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-internacional.yml
Normal file
23
workflows/epc-internacional.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Internacional Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/internacional/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-medi-ambient.yml
Normal file
23
workflows/epc-medi-ambient.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Medi Ambient Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/medi-ambient/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-motor.yml
Normal file
23
workflows/epc-motor.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Motor Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/motor/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-oci-i-cultura.yml
Normal file
23
workflows/epc-oci-i-cultura.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Oci i cultura Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/oci-i-cultura/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-opinio.yml
Normal file
23
workflows/epc-opinio.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Opinió Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/opinio/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-politica.yml
Normal file
23
workflows/epc-politica.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Politica Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/politica/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-portada.yml
Normal file
23
workflows/epc-portada.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Portada Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/portada/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-que-fer.yml
Normal file
23
workflows/epc-que-fer.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Què fer Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/que-fer/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-sabadell.yml
Normal file
23
workflows/epc-sabadell.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Sabadell Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/sabadell/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-sanitat.yml
Normal file
23
workflows/epc-sanitat.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Sanitat Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/sanitat/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-santa-coloma.yml
Normal file
23
workflows/epc-santa-coloma.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Santa Coloma Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/santa-coloma/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-societat.yml
Normal file
23
workflows/epc-societat.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Societat Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/societat/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-tecnologia.yml
Normal file
23
workflows/epc-tecnologia.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Tecnologia Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/societat/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-tele.yml
Normal file
23
workflows/epc-tele.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Tele Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/tele/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-temps.yml
Normal file
23
workflows/epc-temps.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Temps Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/temps/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
23
workflows/epc-terrassa.yml
Normal file
23
workflows/epc-terrassa.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: eP Terrassa Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/36 * * * *' # every 36 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.elperiodico.cat/ca/rss/terrassa/rss.xml ${{ secrets.BSKY_EP_HANDLE }} ${{ secrets.BSKY_EP_USERNAME }} ${{ secrets.BSKY_EP_APP_PASSWORD }}
|
||||||
33
workflows/fcbarcelona.yml
Normal file
33
workflows/fcbarcelona.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCB Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter Meteocat to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCB_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/fcbatletic.yml
Normal file
33
workflows/fcbatletic.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCBAtletic Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCBATLETIC_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/fcbbasket.yml
Normal file
33
workflows/fcbbasket.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCBBasket Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCBBASKET_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/fcbfemeni.yml
Normal file
33
workflows/fcbfemeni.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCBFemení Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCBFEMENI_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/fcbfutbolsala.yml
Normal file
33
workflows/fcbfutbolsala.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCB Futbol Sala Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCBFUTBOLSALA_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/fcbhandbol.yml
Normal file
33
workflows/fcbhandbol.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCBHandbol Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCBHANDBOL_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/fcbhoquei.yml
Normal file
33
workflows/fcbhoquei.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCBHoquei Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCBHOQUEI_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/fcbmasia.yml
Normal file
33
workflows/fcbmasia.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post FCBMasia Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_FCB_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_FCBMASIA_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_MQUB_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_MQUB_PASSWORD }}
|
||||||
33
workflows/meteocat.yml
Normal file
33
workflows/meteocat.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post Meteocat Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter Meteocat to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_APP_PASSWORD }}
|
||||||
33
workflows/mossos.yml
Normal file
33
workflows/mossos.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post Mossos Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_CAT112_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_MOSSOS_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_CAT112_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_CAT112_PASSWORD }}
|
||||||
23
workflows/rac1.yml
Normal file
23
workflows/rac1.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Rac1 Portada Post RSS to BSKY
|
||||||
|
description: "A GitHub Action to post RSS feed items to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 rss2bsky.py https://www.rac1.cat/rss/home.xml ${{ secrets.BSKY_RAC1_HANDLE }} ${{ secrets.BSKY_RAC1_USERNAME }} ${{ secrets.BSKY_RAC1_APP_PASSWORD }}
|
||||||
33
workflows/semgencat.yml
Normal file
33
workflows/semgencat.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post SemGenCat user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_CAT112_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_SEMGENCAT_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_CAT112_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_CAT112_PASSWORD }}
|
||||||
33
workflows/transit.yml
Normal file
33
workflows/transit.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Post Transit Twitter user feed to BSKY
|
||||||
|
description: "A GitHub Action to post from Twitter to Bluesky (BSKY) using a Python script."
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '*/30 * * * *' # every 30 minutes
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
post:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q
|
||||||
|
playwright install chromium
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: |
|
||||||
|
python3 twitter2bsky_daemon.py \
|
||||||
|
--twitter-username ${{ secrets.TWITTER_USERNAME }} \
|
||||||
|
--twitter-password ${{ secrets.TWITTER_PASSWORD }} \
|
||||||
|
--twitter-email ${{ secrets.TWITTER_CAT112_EMAIL }} \
|
||||||
|
--twitter-handle ${{ secrets.TWITTER_TRANSIT_HANDLE }} \
|
||||||
|
--bsky-handle ${{ secrets.BSKY_CAT112_HANDLE }} \
|
||||||
|
--bsky-password ${{ secrets.BSKY_CAT112_PASSWORD }}
|
||||||
Reference in New Issue
Block a user