Compare commits
32 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83c35971ec | ||
|
|
26afa257ca | ||
|
|
8cdfb9e3aa | ||
|
|
23b79d2400 | ||
|
|
e76a7287a8 | ||
|
|
447ced4d17 | ||
|
|
0f50122d3d | ||
|
|
3ffc1ef3e4 | ||
|
|
a82de1da61 | ||
|
|
303ae1311d | ||
|
|
1713e8c78b | ||
|
|
62e9d64e41 | ||
|
|
ab783b1e38 | ||
|
|
6aa03563ac | ||
|
|
9a19eee3e2 | ||
|
|
21e21e92b5 | ||
|
|
f2fa5a0fe1 | ||
|
|
2e1bdc2f09 | ||
|
|
f75df02076 | ||
|
|
3b2ac99311 | ||
|
|
60d8d7f1da | ||
|
|
c032f9e335 | ||
|
|
2bc7db746e | ||
|
|
db92e197fe | ||
|
|
9be923a4c7 | ||
|
|
bda6b60bff | ||
|
|
cd89c2d680 | ||
|
|
bd6161fef7 | ||
|
|
c583ed4d20 | ||
|
|
565ceba521 | ||
|
|
5ea8d0de83 | ||
|
|
d3dd76c48d |
4 changed files with 132 additions and 142 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -6,3 +6,6 @@ urlwatch-1.11.tar.gz
|
|||
/urlwatch-1.18.tar.gz
|
||||
/urlwatch-2.6.tar.gz
|
||||
/urlwatch-2.17.tar.gz
|
||||
/urlwatch-2.21.tar.gz
|
||||
/urlwatch-2.28.tar.gz
|
||||
/urlwatch-2.29.tar.gz
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (urlwatch-2.17.tar.gz) = 264b72b1dafa73898d095e43a341d23fde9e29b0b54a4bc7d5094c8cecb94173792a077a4314b42765dfed376e19052808f4abda3227f3a62e1cd5a3854c101e
|
||||
SHA512 (urlwatch-2.29.tar.gz) = 71e809398ad3b78779174a3a5f1a834d568e476166044c67b3b6d00fda53a4950015c51586a78f70f3637311cd4904257d97eeace4eb602392141a593e03ac7d
|
||||
|
|
|
|||
143
urlwatch.spec
143
urlwatch.spec
|
|
@ -1,21 +1,27 @@
|
|||
Name: urlwatch
|
||||
Version: 2.17
|
||||
Release: 1%{?dist}
|
||||
Version: 2.29
|
||||
Release: 6%{?dist}
|
||||
Summary: A tool for monitoring webpages for updates
|
||||
|
||||
License: BSD
|
||||
License: LicenseRef-Callaway-BSD
|
||||
URL: http://thpinfo.com/2008/urlwatch/
|
||||
Source0: https://github.com/thp/urlwatch/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-idle
|
||||
BuildRequires: python3dist(sphinx)
|
||||
# Build deps for testing
|
||||
BuildRequires: python3dist(pytest)
|
||||
BuildRequires: python3dist(docutils)
|
||||
BuildRequires: python3dist(pycodestyle)
|
||||
|
||||
Requires: python3-requests
|
||||
Requires: python3-keyring
|
||||
Requires: python3-minidb
|
||||
Requires: python3-PyYAML
|
||||
Requires: python3dist(platformdirs)
|
||||
Requires: python3dist(html2text)
|
||||
Requires: python3dist(keyring)
|
||||
Requires: python3dist(lxml)
|
||||
Requires: python3dist(minidb)
|
||||
Requires: python3dist(pyyaml)
|
||||
Requires: python3dist(requests)
|
||||
|
||||
%description
|
||||
This script is intended to help you watch URLs and get notified (via
|
||||
|
|
@ -38,25 +44,130 @@ Basic features
|
|||
%prep
|
||||
%autosetup
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
%pyproject_wheel
|
||||
pushd .
|
||||
cd docs
|
||||
sphinx-build -M html source ../build
|
||||
rm ../build/html/.buildinfo
|
||||
popd
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
# Fix exec permission for rpmlint
|
||||
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/*txt.py
|
||||
chmod a+x %{buildroot}%{python3_sitelib}/%{name}/handler.py
|
||||
%pyproject_install
|
||||
|
||||
%check
|
||||
# test_filter_documentation requires jq and pdftotext which are not packaged in Fedora
|
||||
%pytest lib/urlwatch/tests -k "not test_filter_documentation"
|
||||
|
||||
%files
|
||||
%doc CHANGELOG.md README.md
|
||||
%doc CHANGELOG.md README.md build/html/*
|
||||
%license COPYING
|
||||
%{_mandir}/man*/*.*
|
||||
%{_bindir}/%{name}
|
||||
%{_datadir}/%{name}/examples/
|
||||
%{python3_sitelib}/%{name}/
|
||||
%{python3_sitelib}/%{name}*.egg-info
|
||||
%{python3_sitelib}/%{name}*.dist-info
|
||||
|
||||
%changelog
|
||||
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.29-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Thu Jun 04 2026 Python Maint <python-maint@redhat.com> - 2.29-5
|
||||
- Rebuilt for Python 3.15
|
||||
|
||||
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.29-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 2.29-3
|
||||
- Rebuilt for Python 3.14.0rc3 bytecode
|
||||
|
||||
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 2.29-2
|
||||
- Rebuilt for Python 3.14.0rc2 bytecode
|
||||
|
||||
* Fri Aug 08 2025 Federico Pellegrin <fede@evolware.org> - 2.29-1
|
||||
- Bump to 2.29, add tests execution and docs build
|
||||
|
||||
* Fri Aug 08 2025 Federico Pellegrin <fede@evolware.org> - 2.28-9
|
||||
- Use new Python macros in spec file (rhbz#2378492)
|
||||
|
||||
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.28-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Mon Jun 02 2025 Python Maint <python-maint@redhat.com> - 2.28-7
|
||||
- Rebuilt for Python 3.14
|
||||
|
||||
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.28-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Fri Sep 27 2024 Fabian Affolter <mail@fabian-affolter.ch> - 2.28-5
|
||||
- Adjust requires (closes rhbz#2148282)
|
||||
|
||||
* Wed Sep 04 2024 Miroslav Suchý <msuchy@redhat.com> - 2.28-4
|
||||
- convert license to SPDX
|
||||
|
||||
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.28-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 2.28-2
|
||||
- Rebuilt for Python 3.13
|
||||
|
||||
* Tue Jan 30 2024 Ondřej Nosek <onosek@redhat.com> - 2.28-1
|
||||
- Update to latest upstream release 2.28
|
||||
|
||||
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.21-9
|
||||
- Rebuilt for Python 3.12
|
||||
|
||||
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.21-6
|
||||
- Rebuilt for Python 3.11
|
||||
|
||||
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.21-3
|
||||
- Rebuilt for Python 3.10
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.21-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Thu Nov 26 2020 Ondřej Nosek <onosek@redhat.com> - 2.21-1
|
||||
- Update to latest upstream release 2.21
|
||||
|
||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.17-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.17-6
|
||||
- Rebuilt for Python 3.9
|
||||
|
||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.17-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.17-4
|
||||
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
||||
|
||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.17-3
|
||||
- Rebuilt for Python 3.8
|
||||
|
||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.17-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Mon May 06 2019 Fabian Affolter <mail@fabian-affolter.ch> - 2.17-1
|
||||
- Update to latest upstream release 2.17 (rhbz#1692110)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,124 +0,0 @@
|
|||
--- urlwatch 2009-08-14 01:47:46.457960865 +0200
|
||||
+++ urlwatch_xmpp 2009-08-14 15:46:25.881464617 +0200
|
||||
@@ -55,6 +55,7 @@
|
||||
cache_dir = os.path.join(urlwatch_dir, 'cache')
|
||||
scripts_dir = os.path.join(urlwatch_dir, 'lib')
|
||||
hooks_py = os.path.join(scripts_dir, 'hooks.py')
|
||||
+xmpp_txt = os.path.join(urlwatch_dir, 'xmpp.txt')
|
||||
|
||||
# Check if we are installed in the system already
|
||||
(prefix, bindir) = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0])))
|
||||
@@ -141,8 +142,10 @@
|
||||
parser.add_option('', '--urls', dest='urls', metavar='FILE', help='Read URLs from the specified file')
|
||||
parser.add_option('', '--hooks', dest='hooks', metavar='FILE', help='Use specified file as hooks.py module')
|
||||
parser.add_option('-e', '--display-errors', action='store_true', dest='display_errors', help='Include HTTP errors (404, etc..) in the output')
|
||||
+ parser.add_option('-x', '--xmpp', action='store_true', dest='xmpp', help='Send a message to XMPP clients')
|
||||
+ parser.add_option('', '--xmpp-file', dest='xmpp_file', metavar='FILE', help='Read XMPP login data and recipients from [FILE] instead')
|
||||
|
||||
- parser.set_defaults(verbose=False, display_errors=False)
|
||||
+ parser.set_defaults(verbose=False, display_errors=False, xmpp=False)
|
||||
|
||||
(options, args) = parser.parse_args(sys.argv)
|
||||
|
||||
@@ -176,6 +179,9 @@
|
||||
log.error('%s is not a file' % options.hooks)
|
||||
print 'Error: %s is not a file' % options.hooks
|
||||
sys.exit(1)
|
||||
+
|
||||
+ if options.xmpp_file:
|
||||
+ options.xmpp = True
|
||||
|
||||
# Created all needed folders
|
||||
for needed_dir in (urlwatch_dir, cache_dir, scripts_dir):
|
||||
@@ -201,6 +207,52 @@
|
||||
if not options.hooks and os.path.exists(hooks_py_example) and not os.path.exists(hooks_py_fn):
|
||||
shutil.copy(hooks_py_example, hooks_py_fn)
|
||||
sys.exit(1)
|
||||
+
|
||||
+ if options.xmpp:
|
||||
+ try:
|
||||
+ import xmpp
|
||||
+ except ImportError:
|
||||
+ log.error('python-xmpp not installed')
|
||||
+ print 'Error: You need python-xmpp installed to use the -x switch'
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ if options.xmpp_file:
|
||||
+ if os.path.isfile(options.xmpp_file):
|
||||
+ xmpp_txt = options.xmpp_file
|
||||
+ log.info('using %s as xmpp.txt' % xmpp_txt)
|
||||
+ else:
|
||||
+ log.error('no such file: %s' % options.xmpp_file)
|
||||
+ print 'Error: There is no such file: %s' % options.xmpp_file
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ try:
|
||||
+ xmpp_filehandle = open(xmpp_txt, 'r')
|
||||
+ except IOError:
|
||||
+ log.error('No xmpp.txt file')
|
||||
+ print 'Error: You need to create a xmpp.txt file first.'
|
||||
+ print ''
|
||||
+ print 'Place it in %s' % os.path.dirname(xmpp_txt)
|
||||
+ print ''
|
||||
+ print ''
|
||||
+ print 'Syntax is:'
|
||||
+ print ''
|
||||
+ print '\tsender-username@server.tld senderpassword'
|
||||
+ print '\tfirst-recipient@jabberserver1.tld'
|
||||
+ print '\tsecond-recipient@jabberserver2.tld'
|
||||
+ print '\tthird-recipient@foobarserver.tld'
|
||||
+ print '\t...'
|
||||
+ print ''
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ xmpp_lines = xmpp_filehandle.readlines()
|
||||
+ xmpp_filehandle.close()
|
||||
+ for i in xrange(len(xmpp_lines)):
|
||||
+ xmpp_lines[i] = xmpp_lines[i].strip("\n")
|
||||
+ (xmpp_from, xmpp_pass) = xmpp_lines[0].split(' ')
|
||||
+ xmpp_to = []
|
||||
+ for i in xrange(1, len(xmpp_lines)):
|
||||
+ xmpp_to.append(xmpp_lines[i])
|
||||
+ log.info('using %s to send status messages to %s' % (xmpp_from, xmpp_to))
|
||||
|
||||
headers = {
|
||||
'User-agent': user_agent,
|
||||
@@ -277,18 +329,36 @@
|
||||
end = datetime.datetime.now()
|
||||
|
||||
# Output everything
|
||||
- if len(summary) > 1:
|
||||
+ if len(summary) > 0:
|
||||
log.info('printing summary with %d items' % len(summary))
|
||||
print '-'*line_length
|
||||
print 'summary: %d changes' % (len(summary),)
|
||||
print ''
|
||||
+ msg = ''
|
||||
for id, line in enumerate(summary):
|
||||
print '%02d. %s' % (id+1, line)
|
||||
+ msg += "\n" + '%02d. %s' % (id+1, line)
|
||||
print '-'*line_length
|
||||
print '\n\n\n'
|
||||
+
|
||||
+ if (options.xmpp):
|
||||
+ try:
|
||||
+ (xmpp_user, xmpp_server) = xmpp_from.split('@')
|
||||
+ client = xmpp.Client(xmpp_server)
|
||||
+ client.connect(server=(xmpp_server,5223))
|
||||
+ client.auth(xmpp_user, xmpp_pass, 'urlwatch')
|
||||
+ client.sendInitPresence()
|
||||
+ for to in xmpp_to:
|
||||
+ message = xmpp.Message(to, msg)
|
||||
+ message.setAttr('type', 'chat')
|
||||
+ client.send(message)
|
||||
+ except:
|
||||
+ log.error('Could not send message to %s' % xmpp_to)
|
||||
+ print 'Error: Could not send message to %s' % xmpp_to
|
||||
+
|
||||
else:
|
||||
log.info('summary is too short - not printing')
|
||||
- if len(details) > 1:
|
||||
+ if len(details) > 1 and not options.xmpp:
|
||||
log.info('printing details with %d items' % len(details))
|
||||
print '\n'.join(details)
|
||||
print '-- '
|
||||
Loading…
Add table
Add a link
Reference in a new issue