Commit Graph

67 Commits

Author SHA1 Message Date
Mike Sharov fe24fb933e Use libcurl to download feeds
Replace the custom HTTP client with a libcurl dependency. This
considerably increases snownews capabilities. Most importantly,
https feeds are now supported without using external downloaders.

A lot of code supporting the old HTTP client became obsolete
and was removed, including the direct zlib dependency.
2021-04-10 18:43:09 -04:00
Mike Sharov 48b6eb9630 Support content:encoded tag in RSS feeds
This tag is part of the content module for RSS specification, available
at https://web.resource.org/rss/1.0/modules/content/. The specification
has never been officially approved and is still listed as a draft, but
some sites (such as hackaday) use it instead of putting item text into
the description tag like everyone else does. Closes #52.
2021-04-10 17:00:04 -04:00
Mike Sharov 82ea6230ad Remove obsolete scripts 2021-04-10 16:12:36 -04:00
Mike Sharov de3bd8b281 Implement Atom feed parsing 2021-04-10 14:59:19 -04:00
Mike Sharov 9fb45e4cdf Implement UTF8 text display
This implements straightforward UTF8 to wchar_t to charcell drawing,
sufficient to display languages without nonspacing characters. Those are
all european languages, chinese, and japanese. Languages requiring
multiple characters per cell or complex layout rules are not supported
and can not be supported without a full layout engine, which I am not
qualified to write. Closes #33.
2021-04-10 09:44:09 -04:00
Mike Sharov 0f41d254ba Preserve unescaped text in cache
Non-ascii characters must be escaped in XML elements, so that's what
snownews was doing, resulting in unicode strings being converted to HTML
char codes. In the original feed, these are wrapped in a CDATA element,
which is what this commit does, reducing cache file size.
2021-04-09 18:26:55 -04:00
Mike Sharov 23a08804f8 Run code through indent
This mainly changes the indentation level from 8 to 4 spaces,
because I have difficulty working with the wide indents.
There should be no non-whitespace changes here.
2021-04-09 17:56:41 -04:00
Mike Sharov 5b73b0dad8 Redirect stderr to logfile
Filters and the browser may write error messages to stderr, which
garbles the curses display. This commit redirects stderr descriptor to
/tmp/snownews.log. If no errors are printed, the log file remains empty
and snownews will delete it on exit. Fixes #31
2021-04-09 10:35:25 -04:00
Mike Sharov 9fffb0638c Fix incorrect urls path in opml2snow 2021-04-09 09:44:17 -04:00
Mike Sharov 9d7ac4d48b Always define _GNU_SOURCE 2021-04-08 15:41:39 -04:00
Mike Sharov 11794d7140 Fix newsitem text scrolling 2021-04-08 14:29:50 -04:00
Mike Sharov a10f3540dc Turn off combining pause after pressing Esc 2021-04-08 14:22:10 -04:00
Mike Sharov 23ef101789 Accept repository transfer
Accept repository from #kouya, the original author, who no longer has the
time to maintain it. State in the README that the project is once again
being actively maintained. Update maintainer link in the crash printout.
2021-04-08 12:43:07 -04:00
Mike Sharov 268ef84660 Improve build system
* Add DESTDIR support. Closes issue #39
* Install directories separately from files.
	install command on primitive platforms like BSD does not
	support the -D flag, so destination directories must be
	created separately. Fixes issues #36 and #49
* Add installdirs target.
	In addition to the above, installdirs target conforms to
	GNU makefile conventions.
* Make CFLAGS and LDFLAGS overridable in the Makefile.
	This is done the same way as with DESTDIR, using make CFLAGS=-w,
	which will override CFLAGS for this one build. CFLAGS variable in
	the Config.mk now contains only the optional flags, the warnings,
	and the cflags variable that Makefile uses appends CFLAGS so
	that it can override hardcoded flags in Config.mk. Note that
	configure does not look at CFLAGS environment variable; this is
	only for running make. This closes issue #43
* Check for pkg-config not being installed and don't call it then.
	I didn't check for empty output of which when I wrote this last.
	Should detect no pkg-config properly now and fall back to
	default subs. Fixes issues #35 and #41
2021-04-08 10:47:09 -04:00
Oliver Feiler a243e2b517
Update README.md 2021-02-19 17:44:00 +01:00
Oliver Feiler 1b65ee073e
Merge pull request #38 from doktorhorst/patch-1
fix typos & small corrections
2019-10-11 13:11:47 +02:00
doktorhorst 395fb42e8e
fix typos & small corrections 2019-06-22 16:45:47 +02:00
Oliver Feiler 367fadfb91 Remove old parser test rss file. 2018-07-30 13:15:59 +02:00
Oliver Feiler 71cf768ff7
Merge pull request #29 from msharov/master
Make new release
2018-07-30 13:06:03 +02:00
Mike Sharov f5966dfd54 Bump version number 2018-07-29 09:19:00 -04:00
Oliver Feiler cc2c4a4584
Merge pull request #27 from msharov/master
Add standalone MD5 implementation to remove openssl dependency. Close…
2018-06-06 16:39:38 +02:00
Mike Sharov 1170f79f8e Add standalone MD5 implementation to remove openssl dependency. Closes #6. 2018-06-05 13:06:02 -04:00
Oliver Feiler 165ed7de01
Merge pull request #26 from msharov/master
Remove bash-specific string == from configure
2018-06-05 13:55:02 +02:00
Mike Sharov 02d6a4f0a0 Set feed mtime from marking item read only when it was unread. 2018-06-04 19:55:50 -04:00
Mike Sharov 1528806aa0 Remove bash-specific string == from configure 2018-05-24 20:49:02 -04:00
Oliver Feiler 74a8544f3a
Merge pull request #23 from msharov/master
General code cleanup
2018-05-22 11:23:06 +02:00
Mike Sharov a2d31055f0 Fix new warnings from gcc 8.1 2018-05-09 13:27:03 -04:00
Mike Sharov 6476478c9a Fix clang's warnings about syslog format security 2018-05-02 09:56:08 -04:00
Mike Sharov b584e5568c Merge general cleanup commits 2018-04-30 16:02:47 -04:00
Mike Sharov 527e9ab8cc Make configure options --with-debug and --without-nls work 2018-04-30 16:00:50 -04:00
Mike Sharov 448b8dbf6e Improve random number seeding
Normally rand is only used in santa_hunta, where rng quality is
	unimportant. If /dev/random is unavailable, however, rand is
	used during digest authentication, where it is important.
2018-04-30 15:46:47 -04:00
Mike Sharov 58e8344a82 Add SNOWNEWS_CONFIG_DIR and SNOWNEWS_CACHE_DIR in config.h to replace hardcoded paths 2018-04-30 15:41:50 -04:00
Mike Sharov 37417ab434 Reduce writes to ~/.snownews
Write configuration files only when changed
	Write cache file only when the feed changes
	Write pid lockfile to XDG_RUNTIME_DIR, if available
2018-04-30 15:30:36 -04:00
Mike Sharov 3dd61a9ba2 Flatten man/ hierarchy for easier access 2018-04-30 13:31:06 -04:00
Mike Sharov bb7d3efe3c Construct .mo files only when installing.
Replace dependency on .mo with dependency on .po, allowing make
to see that .po files were not changed since last make install.
2018-04-30 13:17:29 -04:00
Mike Sharov 110145fe13 Remove output to error.log file
This was used only to report http errors. These are already
	printed as part of feed status, and on the status bar after
	the error occured. This commit changes to syslog calls.
2018-04-30 12:53:02 -04:00
Mike Sharov da1b0ed427 Remove checking for snownews update. Closes #21. 2018-04-30 12:42:18 -04:00
Mike Sharov abf9966f5c Sort struct members by type to improve packing
Improve member naming, such as next_ptr to next, override to custom_title, etc.
2018-04-30 11:40:24 -04:00
Mike Sharov 24a28f44d0 Move all global variabls to main.c
Move all global struct definitions to main.h
Merge all global settings into struct settings
Prefix all global variables with _ to emphasize they are global
2018-04-30 11:15:42 -04:00
Mike Sharov d90b962ba3 Merge support.c into about.c. This fixes #17.
Remove check for santa_hunta file.
Add 'S' hotkey in about screen instead.
2018-04-30 10:00:21 -04:00
Mike Sharov 5359416458 General cleanup
Reduce variable scope
	Make functions static when possible
	Make vars const when possible
	Make vars unsigned when possible
	Use bool type from stdbool.h
	Rename some confusingly named variables (i.e. tmp, tmp2)
    	Prefer stack storage to same-scope malloc/free
	Prefer enums for constants
	Prefer sprintf to strcat and other tricks
	Simplify redundant blocks
	Simplify strtok flow
	Remove unnecessary parentheses and braces
	Replace some magic constants with clearer alternatives
	Remove libm dependency (log10 in about.c)
	Make highlight logic in interface.c more consistent
	Fix wrong item being hashed in digcalc
	Remove clear to reduce flicker
	Use = {} for zero-initializing
	Use calloc instead of malloc/manual zeroing
	Make MainQuit be called with an error in a signal handler
	Fix file opening modes to match intended use
	Read and display error log in window instead of using pager
	Remove non-ascii characters from setup.c; replace with hex codes
2018-04-30 09:47:10 -04:00
Oliver Feiler eb4e8c43ee
Merge pull request #20 from msharov/master
Improve build system
2018-04-30 11:09:41 +02:00
Mike Sharov 7afdc53fdc Remove version.h. Use version strings written by configure. 2018-04-27 11:16:48 -04:00
Mike Sharov c75ddea2ce Replace header guards with the universally supported pragma once 2018-04-27 11:05:49 -04:00
Mike Sharov cea1dafb04 Convert all block comments to line comments.
Remove non-ascii characters from source, replace with hex printf.
Translate german comments to english.
Remove profanity from comments.
2018-04-27 10:47:43 -04:00
Mike Sharov f1a7b649f6 Update copyright headers to current recommendations
Recommended header wording copied from https://www.gnu.org/licenses/gpl-howto.html
	The only two changes are to use the project name, Snownews,
	instead of "this program", to clarify that the entire project is
	under the GPL license, rather than only the file with the header.
	The second change is to replace snail mail address with the license
	URL. It is unreasonable to expect users to send an actual letter to
	a US address if the user is in, say, Germany. Postage is expensive.
2018-04-27 09:31:21 -04:00
Mike Sharov 472bac4c5f Improve build system
Use pkg-config to get libraries and cflags
	More dir options for configure
	configure behaves more like autoconf
	config.status remembers configure flags
	Separate builddir
	Automatic dependency generation
	Wildcard source discovery
	Dependency based installation
	uninstall target
2018-04-26 17:38:50 -04:00
Oliver Feiler 9285390074
Merge pull request #19 from msharov/master
Make it compile cleanly
2018-04-26 12:56:09 +02:00
Mike Sharov cff110ac98 Make it compile cleanly
Fix openssl MD5 hash calculations; context struct is private
		and must be created with helper functions.
	Add -Wextra to compile flags and fix all warnings.
2018-04-25 11:17:06 -04:00
Oliver Feiler 83a049de95
Mention gettext and its utils in build requirements 2018-01-05 16:48:06 +01:00