oelna / microblog Goto Github PK
View Code? Open in Web Editor NEWA simple-ish PHP app that stores status updates as small posts in a SQLite database.
License: MIT License
A simple-ish PHP app that stores status updates as small posts in a SQLite database.
License: MIT License
Does this project have a license? If not, you could pick:
You can add the licenses just by putting them in a file called LICENSE
or COPYING
. Additionally, you should add something in the README (and optionally all source files), depending on the license.
For Apache 2.0:
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For the GPLv3:
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 <http://www.gnu.org/licenses/>.
For the AGPLv3:
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 Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
For MIT, it's short enough that for such a notice you can just use the full text of the license.
MIT License
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
One thing that's been weighing on me for a while since discovering this project is that you chose to implement the xml feed with Atom rather than RSS 2.0. This surprised me because Atom specifies that every post must have a title and a defining feature of RSS and the microblog effort is that titles are optional. One of the things I'm thinking about working on next is getting the xml feed closer to parity with the json feed with image attachments support, but my inclination is to do the work in a new rebuild_rss_feed() function and leave the Atom support alone. Does that sound reasonable to you? An RSS implementation could also allow for micro podcast support in the future as well if we just passed entries with audio attachments.
This should really support ActivityPub, maybe via https://github.com/landrok/activitypub
Could make it a solid single-user Twitter/Mastodon alternative that can still me hosted relatively easily.
Here's a small function that will convert youtube links in your post to embed youtube player. I was too lazy to modify the autolink function because it's not documented properly. So I just wrapped this function with it inside the template. Feel free to add it to the next update @oelna
function youtube($string,$autoplay=0,$width=480,$height=390)
{
preg_match('#(?:https://)?(?:www\.)?(?:youtube\.com/(?:v/|watch\?v=)|youtu\.be/)([\w-]+)(?:\S+)?#', $string, $match);
if(isset($match[1])) {
$embed = '<iframe title="YouTube video player" width="100%" height="350" src="http://www.youtube.com/embed/'.$match[1].'?autoplay=$autoplay" frameborder="0" allowfullscreen></iframe>';
return str_replace($match[0], $embed, $string);
}
else return $string;
}
Not Found
The requested URL /microblog/mb/login was not found on this server.
Apache/2.4.23 (Win64) PHP/5.6.25 Server at localhost Port 80
I can see the code looks at path(0) for 'login' - but path(0) is not login..
Any help appreciated.
@oelna I'm getting too many redirects error.
DB file was automatically created so at least it ran through some of it.
.htaccess looks like this. I've only added RewriteCond %{SERVER_PORT} 8888. because the default url for mamp is localhost:8888 but the error persists even without my line.
AddCharset UTF-8 .xml
AddCharset UTF-8 .json
AddType application/atom+xml .xml
AddType application/json .json
<Files ~ "\.db$">
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
</IfModule>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
</Files>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /microblog
# friendly URLs
RewriteRule ^feed/json/?$ feed/feed.json [L]
RewriteRule ^feed/atom/?$ feed/feed.xml [L]
RewriteCond %{SERVER_PORT} 8888
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
Error log says:
RewriteCond: bad flag delimiters
Any ideas?
omg what was I thinking?
Hey! I had been looking for ultra-minimal micro-blogging software for quite some time, and today I came across Microblog, which seemed simple enough for my needs. My goal is to create a micro-blogging service for myself, where I can post only to myself, as I need a place to vent and express myself privately.
However, in order for Microblog to be useful to me, it required some taming. I removed ActivityPub and Twitter support, added a config parameter for the database path, fixed localhost deployments (for testing), and fixed other small things that were very broken (how could everything in lib/
even load with incorrect paths in the default config!?)
Here's the repository of my fork: https://git.avalos.me/microblog
Feel free to take what you wish from my fork.
If you want to embed content into posts using a URL (videos, photos, etc) autolink will mess it up and it won't work.
There's reasons for it being a feature, this more of a tip for others, as I spent some time trying to figure out why I couldn't embed media.
The function autolink is referenced here and here.
To disable it :
autolink($post['post_content'])
-> $post['post_content']
Export entries and attachments to the Blog Archive Format
Contains a JSON feed, h-feed HTML and the attached files.
use variables, light and dark mode, system colors, aim for a native experience, at least with one theme (plain
?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.