Quick and Dirty Self-Hosted Alexa Skills (2019)

by @edent | # # # # # # | 3 comments | Read ~330 times.

I hate creating Alexa skills. What should be a 3-click process inevitably ends up requiring trips to multiple websites, to set up weird parameters, and reading outdated tutorials for obsolete libraries. So this is how to create a self-hosted Skill, using PHP. It runs on your own server and doesn't require any interaction. The Skill…

Continue reading →

Import Images From A Migrated WordPress

by @edent | # # # # # | Read ~400 times.
The Logo for WordPress

Here's how to solve a common WordPress problem. I want to re-import all my blog's images into the media library. I've moved my blog to a new host - but kept the same domain name. I started with a new WordPress install, the uploads folder still has all my images, but WordPress can't see them.…

Continue reading →

A UTF-8 Aware substr_replace (for use in App.net)

by @edent | # # # # | Read ~1,066 times.

So, I stayed up bashing my head against a brick wall all last night! PHP's string functions aren't (yet) UTF-8 aware. This is a replacement for subtr_replace which should work on UTF-8 Strings: function utf8_substr_replace($original, $replacement, $position, $length) { $startString = mb_substr($original, 0, $position, "UTF-8"); $endString = mb_substr($original, $position + $length, mb_strlen($original), "UTF-8"); $out =…

Continue reading →

Introducing a NEW QR Generator

by @edent | # # # # # | 4 comments | Read ~1,028 times.

When people ask me which QR generator to use, I usually suggest Google Charts. However, recently I've become dissatisfied with its limitations, so I've decided to write and release my own QR encoder. I'm still looking for a catchy name for it (suggestions welcomed) - so for now it's called "QR Generator PHP". It's available…

Continue reading →

Calibre PHP Patches

by @edent | # # # # | Read ~130 times.

Two quick patches which should be in the next version of Calibre PHP. Adding File Size This shows the sizes of the eBook files. Screenshot shows a demonstration using the free "Hacking The BBC" eBook.

Continue reading →

Installing Calibre PHP

by @edent | # # # # # # | Read ~1,954 times.

(These are mostly notes to myself!) I love Calibre, it's the perfect eBook management tool. It comes with a built in WWW server so you can easily access your library on the go. The only problem is that this really only works if you have a single machine dedicated to Calibre. For various reasons, I…

Continue reading →

Displaying Twitter Photos via Entities

by @edent | # # # # # # # | 3 comments | Read ~1,865 times.

Twitter has announced that it will soon open up a native photo sharing service. Rather than using an external service like Embed.ly to retrieve thumbnails, all the data is embedded within Twitter Entities. So, if you request a status using "include_entities=true", you will be able to grab the image and display the thumbnail using the…

Continue reading →

HOWTO: Twitpic and OAuth

by @edent | # # # # # # | 25 comments | Read ~5,128 times.

I am no longer confused! Here is a quick tutorial in how to post images to Twitpic and Twitter when using OAuth. I'm indebted to Steve Corona of Twitpic, for his help with this. You can see the full code on Dabr's Google Code page. First of all, you'll need to have enabled OAuth for…

Continue reading →

Twitpic OAuth - I'm Stuck

by @edent | # # # # # # | 14 comments | Read ~3,261 times.

Twitpic has implemented an OAuth API. No more having to hand out passwords to all and sundy. Only I'm too much of a dunderhead to get it working. Perhaps it's a combination of heatstroke or this rotten head-cold, but I just can't see what I'm doing wrong. Any help much appreciated. The easy bit. It's…

Continue reading →

Twitter and Linebreaks

by @edent | # # # # # # # | 6 comments | Read ~28,232 times.

As any student of computer science knows, line breaks are confusing. There are styles of line breaks unique to Unix, Mac and Windows - so what should a web renderer do when faced with a newline command? In HTML, it's simple, they should be ignored. But what when it is user generated text, not HTML?…

Continue reading →