在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):passthejoe/blogPoster开源软件地址(OpenSource Url):https://github.com/passthejoe/blogPoster开源编程语言(OpenSource Language):Ruby 100.0%开源软件介绍(OpenSource Introduction):blogPosterWhat is blogPoster?blogPoster aims to make it easy to create social-media-style posts and send those posts to both a social-media service and a personal blog. This is a very personal project that I use just about every day. Right now it's a terminal program that uses Ruby and a few gems to take URLs and make quick and easy social-media entries based on them. blogPoster can also create posts "from scratch," meaning you can begin by inputting a title and text without a URL. You can add any URL you want to any post and even change the URL on the post you're already working on. The way the app is structured right now, it creates and formats posts for an Ode blog and the Twitter and Mastodon social-media services. Update on 8/8/21: Mastodon posting has been fixed. The code is much simpler, and I am no longer using the mastodon-api gem. Instead, posting is done with the http gem. Thanks to this Python-focused article for the idea. All I did was "translate" from Python to Ruby. I'm pretty sure you haven't heard of Ode, the Rob Reed-coded, Perl-based blogging software that is inspired by Bloxsom (see a little more on Wikipedia). I used Ode as my personal blogging system for many years (that site is archived here now), and right now Ode is running my microblog. Ode is well-suited to a project like a personal microblog because it's easy to modify the themes to show just the post body, though I don't think that's strictly necessary for a microblog site using a traditional blog CMS like WordPress. My development roadmap includes modifying this script to create entries for popular static-site generators like Hugo and Jekyll. This and other development goals are laid out on the project's issues page in GitHub. Adding to the targeted blogging systems should really make this script valuable beyond the extremely small Ode community. In case you're wondering where the idea of a microblog comes from, aside from the fact that your Twitter feed is sort of, kind of, already a microblog, I found inspiration for this project in two microblogging pioneers:
Update on Aug. 9, 2021
This project is for learningI came up with this project to solve a problem. But another key purpose is to give me a reason to learn more programming and development skills. This is how I figure out Ruby, git and GitHub. What started as a purely imperative-style script is slowly incorporating Ruby modules and — hopefully in the near-future — classes. What do you need to have in place to run blogPoster?At this point, blogPoster isn't a complete, stand-alone system. It's a Ruby script and a few extra files. To run the script, you need the Ruby programming language, a compatible text editor and a few Ruby gems. Install the following Ruby gems:
And if you are running this program on Windows, install this one too:
Tips from the Nokogiri project on installing the gem: They offer instructions for Linux, MacOS, Windows, FreeBSD and OpenBSD. And as I say above, on Windows computers, you'll have to add the Note on Ruby Gems: In response to a tweet about using Linux distribution packages to install Ruby gems, a couple of developers replied to say that they don't recommend using distribution-packaged gems, or even distribution-packaged Ruby. (Many favor the use of RVM, which is something I'm open to trying but haven't yet. But they definitely are in favor of getting gems via Ruby's Which version of Ruby? As of Jan. 7, 2021, blogPoster — with the proper Ruby gems installed — runs on Ruby 2.5, 2.6 and 2.7 and 3.0 in Linux and 2.5, 2.6, 2.7 and 3.0 in Windows. I have tested the script extensively on Linux and Windows systems, and it works pretty much the same on both. I have done some tests in MacOS, but I need to revisit them. Tips for Fedora Linux usersUpdate on 4/16/2022: To run blogPoster on Fedora Linux (last tested on F36 Silverblue), add the Ruby programming language, packages for the gems that are in the distribution, and a few development packages so you can build the Twitter gem when you install it with
Then use
Why does blogPoster use an external text editor, and which one should I choose? The biggest variable is your choice of text editor, which the script uses to edit posts. I used the coding and testing of this script as an "excuse" to learn Vim, and I am glad I did. But the script works very well with other editors. It is very compatible with I haven't tried a lot of other editors with Linux, but that is something I will do in the future, and I will report the results in this file. I use On some systems, As I say below, setting Vim as your preferred blogPoster text editor is a great way to learn Vim. It worked for me. What about JRuby (and compatible text editors)? BlogPoster works with JRuby. I tried version 9.2.7.0 in Windows, using You really don't have to use a text editor with the script if you don't want to. You can do everything in the console (i.e. at the command line), though bringing in a text editor makes it much easier to craft your posts. Do you need a stand-alone blogging system to use blogPoster?No. You can use blogPoster just for posting to Twitter or Mastodon, or just for posting to your blog/microblog. It's flexible that way. While the blog-posting portion of blogPoster in its default configuration is very much Ode-specific, you can and should modify it for your file-based blogging system. As I say above, this is on my roadmap for the project. Uploading to a blog or site via secure FTPWhat you need:
As of March 1, 2020, the script uses SFTP — via the To use this app for posting to your blog, you'll need to enter your FTP login and password in the configuration file The That same configuration file also lets you select your file suffix. I use Posting to TwitterBefore you use the app to post to Twitter, you need to get access to the Twitter API via a a Twitter Development Account, which is harder to get than it used to be but not at all impossible. When you fill out Twitter's online form to "register" your instance of blogPoster, you basically need to tell them you are using a Ruby script to post tweets from your desktop. Once they review your request, they should say "OK," and give you the keys/tokens you need to enter in The first time I requested access to the Twitter API, it all went smoothly. All I had to do was tell them what my app was going to do. I had to do this a second time due to changes Twitter made in their API agreement. This time they came back with further questions, and I just restated what I said before. It was the coding equivalent of "These are not the 'droids you're looking for." And it worked. Aside: I would like to turn this into a graphical app that allows users to log in using their Twitter credentials and not require them to get API access, but that's a project for the future. Posting to a Mastodon instanceDocumentation for posting to Mastodon will go here at some time in the near future. Note to developersIf you are running blogPoster and also trying to hack on it using This will change: In the near future, this shouldn't be a problem because I'm very strongly considering doing away with the post-file archive. The script doesn't make use of the archived files, and if you successfully use blogPoster to create and post an entry, you should have the actual files on your targeted microblog as an archive. This move will eliminate a few entries in |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论