I’ve been using a custom YOURLS system to create my own URL shortener for my blog network for a while now. Everything works just great with only a few exceptions (bugs already reported to the developer).
But I’m aiming for something a bit more complicated that’s not included in the existing WordPress YOURLS plug-in.
Currently
Right now, when a post is published, WordPress automatically logs in to YOURLS, creates a short URL, and pushes a notification to Twitter. It works well and keeps track of everything for me (the short URL is memorized by WordPress and inserted into appropriate <meta>
tags as well).
What I want to do
I schedule my blog posts for 8am Pacific Time. This works well if you’re on Twitter at 8am. But some people are browsing at lunch. Some in the evening.
I want to schedule automated re-tweets of my short URL from within WordPress. Some posts I want pushed out once … others I want pushed out at 2 or 3 strategic times during the day. How would I go about doing this?
I would probably go about this way:
The plugin has a function called:
wp_ozh_yourls_send_tweet($tweet);
as you can see it accepts the tweet message and posts it to twitter,
also it has another function called:
wp_ozh_yourls_geturl( $post_id );
which accepts a post id and returns a shorturl as string.
so after knowing that I would use these two in conjunction with wordpress’s
wp_schedule_single_event
and create my own function to use the plugins functions.
Now after that is said knowing how OZH codes his plugins i bet you can find hooks somewhere in there that will make you life a lot easier.
Hope this helps.