diff --git a/README.html b/README.html index 1bfca98..19a9e47 100644 --- a/README.html +++ b/README.html @@ -1,204 +1,287 @@

a command-line based blogging platform running on tilde.town

-

ttbp stands for "tilde.town blogging platform", the original working name for + +

ttbp stands for “tilde.town blogging platform”, the original working name for this project.

-

ttbp main menu screenshot

-

ttbp entries view screenshot

-

ttbp compose view screenshot

+ +

ttbp main menu screenshot

+ +

ttbp entries view screenshot

+ +

ttbp compose view screenshot

+

ttbp runs from the command line, providing a hub for writing personal blog -posts and reading posts written by other users of tilde.town. it's a little bit +posts and reading posts written by other users of tilde.town. it’s a little bit like livejournal or dreamwidth or tumblr. you can opt to publish your posts to a -public html file hosted on your tilde page, to tilde.town's gopher server, or +public html file hosted on your tilde page, to tilde.town’s gopher server, or keep all your entries private to the tilde.town server.

+

to use, run feels while logged in to tilde.town

+

this is a project that runs on tilde.town, so all users of this program are expected to operate under the tilde.town code of conduct. content/personal issues should be worked out according to the CoC, with support from the administrative team if needed.

+

QUICK START

+

no coding or html experience is necessary to get started. just log in to your tilde.town account and enter:

+

feels

+

ttbp will ask you a few questions to get you started. after that, writing and reading entries all happen within the program.

-

that's it!

+ +

that’s it!

+

support

-

if you're having trouble getting started, or run into program errors or strange -behavior, please send internal tilde.town mail to ~endorphant and i'll try to + +

if you’re having trouble getting started, or run into program errors or strange +behavior, please send internal tilde.town mail to ~endorphant and i’ll try to sort things out!

-

there's also a function from the main menu that lets you send feedback/inquiries -to me directly; this uses internal tilde.town mail, which is what i'll respond + +

there’s also a function from the main menu that lets you send feedback/inquiries +to me directly; this uses internal tilde.town mail, which is what i’ll respond to.

+

writing entries

+

entries are recorded as plaintext files in your ~/.ttbp/entries directory. ttbp will use your selected editor to open and write files; each day is its -own entry, like a diary page. at midnight for whatever timezone you've set for -your user account on tilde.town, you'll get a fresh entry. if you don't write +own entry, like a diary page. at midnight for whatever timezone you’ve set for +your user account on tilde.town, you’ll get a fresh entry. if you don’t write any feels on a particular day, no entries will show up there.

+

when you save and quit the text editor, your entry will automatically propagate -to the global feels list; if you've opted to publish your feels to html/gopher, -those files will update immediately. you can always go back to the current day's -entry and edit/add as you'd like, but older entries will not be available for +to the global feels list; if you’ve opted to publish your feels to html/gopher, +those files will update immediately. you can always go back to the current day’s +entry and edit/add as you’d like, but older entries will not be available for editing from ttbp.

-

(since files are just stored as plaintext in your directory, it's possible to + +

(since files are just stored as plaintext in your directory, it’s possible to edit and move old entries directly from the command line. however, changing old entries might cause strange things to happen with timestamps. the main program looks at the filename first for setting the date, then the last modified time to -sort recent posts. it expects YYYMMDD.txt as the filename; anything else won't +sort recent posts. it expects YYYMMDD.txt as the filename; anything else won’t show up as a valid entry. yes, this means you can post things out of date order by creating files with any date you want.)

+

general entry-writing notes

+ + +

reading other feels

+

the browse global feels feature shows the ten most recent entries that anyone has written on ttbp. this list is only accessible from within tilde.town, although individual entries may be posted to html or gopher.

-

you can also pull up a list of a single user's feels through check out your + +

you can also pull up a list of a single user’s feels through check out your neighbors, which displays all users who are writing on ttbp based on their -most recently updated entry, and a link to their public html blog if they've +most recently updated entry, and a link to their public html blog if they’ve opted to publish their posts.

+

please note! entries written on ttbp should be considered sensitive, private information, even if a particular user is publishing entries in a -world-viewable way! please be respectful about having access to other people's +world-viewable way! please be respectful about having access to other people’s feels, and do not copy/repeat any information without getting their explicit permission. tilde.town operates on a high level of mutual trust, and ttbp is designed to give individuals control over their content.

+ +

subscribing to users

+ +

the visit your subscriptions feature lets you view recent entries from a list +of users you’ve subscribed to, as well as manage your subscription list. your +list is saved to ~/.ttbp/config/subs, which gets automatically updated when +you add or remove subscriptions from ttbp.

+ +

your subscription list is private; this means no one other than you can see who +you’re following. subscription view only shows the 50 most recent entries from +your subscribe list; if you want to see more entries from an individual, you +can navigate to their entries in `check out your neighbors from the main +menu.

+

privacy

+

when you start your ttbp, you have the option of publishing or not publishing your blog.

+

if you opt to not publish, your entires will never be accessible from outside of the tilde.town network; other tilde.town users will still be able to read your entries through the ttbp interface, or by directly accessing your ~/.ttbp/entries directory.

+

if you want to further protect your entries, you can chmod 700 your entries directory.

+

if you opt to publish, the program creates a directory ~/.ttbp/www where it stores all html files it generates, and symlinks this from your ~/public_html with your chosen blog directory. your blog will also be listed on the main ttbp page.

+

you can also opt to publish to gopher, and the program will automatically generate a gophermap of your feels.

+

you can set publishing status on individual entries, or bury individual feels; -see "data management" below for details.

+see “data management” below for details.

+

data management

+

the manage your feels menu provides several tools for organizing your feels. these are all actions you can perform manually from the command line, but doing them from within the program can help keep your files properly linked up.

+ + +

settings

+

the settings menu lets you change specific options for handling your feels and using the interface.

+ + +

changing your page layout

+

you can modify how your blog looks by editing the stylesheet or header and footer files. the program sets you up with basic default. if you break your page somehow, you can force the program to regenerate your configuration by deleting your ~/.ttbp directory entirely. you might want to back up your ~/.ttbp/entries directory before you do this.

+ + +

general tips/troubleshooting

+ + +

future features

+

these are a few ideas being kicked around, or under active development:

+ + +

other ideas are listed on github as upcoming features or feature requests!

+

dependencies

+

(this section is only relevant if you plan on forking the repo and running an instance of this yourself)

+ + +

contributing

+

please check out my contributor guidelines -on github if you'd like to get involved with development!

+on github if you’d like to get involved with development!

+

if you find any bugs or strange behavior, please message me locally on tildemail -or open a github issue and i'll get back to you as soon as i can.

-

if you're interested in helping with the code, please drop me some tildemail!

+or open a github issue and i’ll get back to you as soon as i can.

+ +

if you’re interested in helping with the code, please drop me some tildemail!

+

i accept tips for development work on liberapay

+

contributor shout-outs

+

thanks to:

+ \ No newline at end of file + + diff --git a/README.md b/README.md index f32c4f4..eb3aeb0 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,19 @@ feels, and do not copy/repeat any information without getting their explicit permission. tilde.town operates on a high level of mutual trust, and `ttbp` is designed to give individuals control over their content. +### subscribing to users + +the `visit your subscriptions` feature lets you view recent entries from a list +of users you've subscribed to, as well as manage your subscription list. your +list is saved to `~/.ttbp/config/subs`, which gets automatically updated when +you add or remove subscriptions from ttbp. + +your subscription list is private; this means no one other than you can see who +you're following. subscription view only shows the 50 most recent entries from +your subscribe list; if you want to see more entries from an individual, you +can navigate to their entries in `check out your neighbors from the main +menu. + ### privacy when you start your ttbp, you have the option of publishing or not publishing diff --git a/ttbp/config/__init__.py b/ttbp/config/__init__.py index 7a00748..c16eecb 100644 --- a/ttbp/config/__init__.py +++ b/ttbp/config/__init__.py @@ -76,6 +76,7 @@ MAIN_FEELS = os.path.join(PATH, 'entries') BURIED_FEELS = os.path.join(PATH, 'buried') NOPUB = os.path.join(USER_CONFIG, 'nopub') BACKUPS = os.path.join(PATH, 'backups') +SUBS = os.path.join(USER_CONFIG, 'subs') ## UI @@ -86,7 +87,7 @@ ___________________________________________________________ | ____ ____ ____ _ ____ ____ _ _ ____ _ _ _ ____ | | |___ |___ |___ | [__ |___ |\ | | __ | |\ | |___ | | | |___ |___ |___ ___] |___ | \| |__] | | \| |___ | -| ver 0.12.0 | +| ver 0.12.1 | |__________________________________________________________| '''.lstrip() # ~ u n s t a b l e e x p e r i m e n t a l b r a n c h ~ @@ -291,5 +292,21 @@ version 0.9.3 features: i'm just making this option available for anyone whose financially stable and wants to kick some spare change my way; this is a labor of love, and i'm happy to work on it regardless :) +""", + "0.12.1":""" +~[version 0.12.1 update]~ + + new feature: "visit your subscriptions" + * view recent entries from a list of townies you've subscribed to + * subscription list is private; no one else can see who you're following + * add/remove users from the subscription menu + + minor changes: + * global feed now shows 50 most recent entries, which you can scroll through + * documentation page updated to reflect new feature + + thanks for those of your who've written me with feedback! + + keep feelin' together <3 """ } diff --git a/ttbp/ttbp.py b/ttbp/ttbp.py index 6ee3b26..1cdd0d1 100644 --- a/ttbp/ttbp.py +++ b/ttbp/ttbp.py @@ -51,7 +51,7 @@ from . import chatter from . import gopher from . import util -__version__ = "0.12.0" +__version__ = "0.12.1" __author__ = "endorphant if you didn't mean to do this.") core.load(setup()) # reload settings to core - elif choice == '6': + elif choice == '7': redraw("you're about to send mail to ~endorphant about ttbp") feedback_menu() - elif choice == '7': + elif choice == '8': redraw() show_credits() - elif choice == '8': + elif choice == '9': subprocess.call(["lynx", os.path.join(config.INSTALL_PATH, "..", "doc", "manual.html")]) redraw() elif choice in QUITS: @@ -690,6 +695,56 @@ def review_menu(intro=""): redraw(top+intro) return review_menu(intro) +def subscription_handler(intro=""): + ''' + submenu for managing subscriptions + ''' + + if not os.path.exists(config.SUBS): + subprocess.call(["touch", config.SUBS]) + subprocess.call(["chmod", "600", config.SUBS]) + + subs_raw = [] + if os.path.isfile(config.SUBS): + for line in open(config.SUBS, "r"): + subs_raw.append(line.rstrip()) + + subs = [] + all_users = core.find_ttbps() + for name in subs_raw: + if name in all_users: + subs.append(name) + + menuOptions = [ + "view subscribed feed", + "manage subscriptions" + ] + + util.print_menu(menuOptions, SETTINGS.get("rainbows", False)) + + choice = util.list_select(menuOptions, "what would you like to do with your subscriptions? (or 'q' to return home) ") + + top = "" + + if choice is not False: + if choice == 0: + if len(subs) > 0: + prompt = "most recent entries from your subscribed pals:" + redraw(prompt) + view_subscribed_feed(subs, prompt) + else: + intro = "it doesn't look like you have any subscriptions to see! add pals with 'manage subscriptions' here." + elif choice == 1: + prompt = "options for managing your subscriptions:" + redraw(prompt) + subscription_manager(subs, prompt) + else: + redraw() + return + + redraw(top+intro) + return subscription_handler(intro) + def view_neighbors(users, prompt): ''' generates list of all users on ttbp, sorted by most recent post @@ -1275,14 +1330,43 @@ def show_entry(filename): return -def view_feed(): +def view_global_feed(): ''' - generate and display list of most recent global entries + display list of most recent global entries + ''' + + (entries, metas)= feed_list(core.find_ttbps()) + list_entries(metas, entries, "recent global entries:") + redraw() + + return + +def view_subscribed_feed(subs, prompt=""): + ''' + display list of most recent entries on user's subscribed list. + ''' + (entries, metas)= feed_list(subs, 0) + list_entries(metas, entries, prompt) + redraw() + + return + +def feed_list(townies, delta=30): + ''' + given a list of townies, generate a list of 50 most recent entries within + given interval (default 30 days; 0 days for no limit). validates against + townies with ttbp config files. + + returns a tuple of (entries, metas) ''' feedList = [] + all_users = core.find_ttbps() + + for townie in townies: + if townie not in all_users: + continue - for townie in core.find_ttbps(): entryDir = os.path.join("/home", townie, ".ttbp", "entries") try: filenames = os.listdir(entryDir) @@ -1290,36 +1374,122 @@ def view_feed(): filenames = [] for entry in filenames: - ## hardcoded display cutoff at 30 days - if core.valid(entry): - year = int(entry[0:4]) - month = int(entry[4:6]) - day = int(entry[6:8]) - datecheck = datetime.date(year, month, day) - displayCutoff = datetime.date.today() - datetime.timedelta(days=30) + if delta > 0: + if core.valid(entry): + year = int(entry[0:4]) + month = int(entry[4:6]) + day = int(entry[6:8]) + datecheck = datetime.date(year, month, day) + displayCutoff = datetime.date.today() - datetime.timedelta(days=delta) - if datecheck > displayCutoff: - feedList.append(os.path.join(entryDir, entry)) + if datecheck > displayCutoff: + feedList.append(os.path.join(entryDir, entry)) + else: + feedList.append(os.path.join(entryDir, entry)) metas = core.meta(feedList) metas.sort(key = lambda entry:entry[3]) metas.reverse() entries = [] - for entry in metas[0:10]: + for entry in metas[0:50]: pad = "" if len(entry[5]) < 8: pad = "\t" entries.append("~{user}{pad}\ton {date} ({wordcount})".format( - user=entry[5], pad=pad, date=entry[3], + user=entry[5], pad=pad, date=entry[3], wordcount=p.no("word", entry[2]))) - list_entries(metas, entries, "most recent global entries:") + return entries, metas - redraw() +def subscription_manager(subs, intro=""): + ''' + ''' - return + menuOptions = [ + "add pals", + "remove pals" + ] + + util.print_menu(menuOptions, SETTINGS.get("rainbows", False)) + + choice = util.list_select(menuOptions, "what do you want to do? (enter 'q' to go back) ") + + top = "" + + if choice is not False: + if choice == 0: + prompt = "list of townies recording feels:" + redraw(prompt) + subs = subscribe_handler(subs, prompt) + elif choice == 1: + prompt = "list of townies you're subscribed to:" + redraw(prompt) + subs = unsubscribe_handler(subs, prompt) + else: + redraw() + return + + redraw(top+intro) + return subscription_manager(subs, intro) + +def unsubscribe_handler(subs, prompt): + ''' + displays a list of currently subscribed users and toggles deletion. + ''' + + subs.sort() + + choice = menu_handler(subs, "pick a pal to unsubscribe (or 'q' to cancel): ", 15, SETTINGS.get("rainbows", False), "list of townies recording feels:") + + if choice is not False: + townie = subs[choice] + subs.remove(townie) + save_subs(subs) + redraw("{townie} removed! \n\n> {prompt}".format(townie=townie, prompt=prompt)) + return unsubscribe_handler(subs, prompt) + else: + redraw() + return subs + +def subscribe_handler(subs, prompt): + ''' + displays a list of all users not subscribed to and toggles adding, + returning the subs list when finished. + ''' + + candidates = [] + + for townie in core.find_ttbps(): + if townie not in subs: + candidates.append(townie) + + candidates.sort() + + choice = menu_handler(candidates, "pick a townie to add to your subscriptions (or 'q' to cancel): ", 15, SETTINGS.get("rainbows", False), "list of townies recording feels:") + + if choice is not False: + townie = candidates[choice] + subs.append(townie) + save_subs(subs) + redraw("{townie} added! \n\n> {prompt}".format(townie=townie, prompt=prompt)) + return subscribe_handler(subs, prompt) + else: + redraw() + return subs + +def save_subs(subs): + ''' + takes given subscription list and saves it into the user config, + overwriting whatever is already there. + ''' + + subs_file = open(config.SUBS, 'w') + + for townie in subs: + subs_file.write(townie + "\n") + subs_file.close() def graffiti_handler(): ''' @@ -1710,15 +1880,15 @@ something strange happened to you during this update. # version 0.11.0 patch notes print(config.UPDATES["0.11.0"]) - if y < 11 or z < 1: + if y < 11 and z < 1: # version 0.11.1 patch notes print(config.UPDATES["0.11.1"]) - if y < 11 or z < 2: + if y < 11 and z < 2: # version 0.11.2 patch notes print(config.UPDATES["0.11.2"]) - if y < 11 or z < 3: + if y < 11 and z < 3: # version 0.11.3 patch notes print(config.UPDATES["0.11.3"]) @@ -1726,6 +1896,10 @@ something strange happened to you during this update. # version 0.12.0 patch notes print(config.UPDATES["0.12.0"]) + if z < 1: + # version 0.12.1 patch notes + print(config.UPDATES["0.12.1"]) + confirm = "" while confirm not in ("x", "", "X", ""):