I have my site set up using the modules
- Twitter 6.x-3.0-beta2 (altered to use the microblogging service identi.ca)
- TweetRSS 6.x-1.0-beta1
- Regex match setup like so
/.+?<title>(.+?)<\/title>.*?<link>(.+?)<\/link>.*/ - Regex replace setup like so
$1 $2 - Shorten URL's 6.x-1.10
- Submodule Shorten URLs Custom Services
- Short URL 6.x-1.2.
It functions great in regards to
- Announcing new blog posts and other drupal nodes to identi.ca/Twitter
- Shortening the announce url's of those posts using any number of services, including, and most noticeably using my own URL
- Announcing new items in selected aggregated feeds to microblogging services.
But I have not been successful in getting the URLs of the aggregated items that TweetRSS sends to twitter to shorten using any service at all. How do I get the URLs shortened before they are sent off? I don't see any option in the admin settings to enable this function?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | tweetrssshorten.tar_.gz | 715 bytes | siblog |
Comments
Comment #1
cleaver commentedThe URL shortening is done in the Twitter module, but it looks like it only does the shortening on the new node post using tokens. I guess an ordinary url passed through the Twitter API doesn't get shortened.
This sort of falls in between the two modules, but I'll keep it open here. No need to open a ticket under Twitter module. If it looks like I can address it in TweetRSS, I'll change this to a feature request.
Timeline on this might be a bit longer than usual due to my travel schedule.
Comment #2
siblog commentedI created a quick and dirty add-on module (works with 6.x-1.0-beta1) that is specific to my needs to shorten the url via the "Shorten" module.
I personally wanted only the title and link. I also wanted to prepend and append text to the tweet so I used the regex_match and regex_replace fields for that. The end product was dead simple because of the great hooks available. Here is the contents of the module file:
So once you install this add-on module you select 'Tweet RSS Shorten' in the dropdown of the TweetRSS feed settings and then put what you want to prepend to the tweet in the regex_match field and what you want to append to the tweet in the regex_replace field.
This add-on module is attached. Hopefully it helps or gives you a place to start
Comment #3
cleaver commentedThanks for the code. It gets me thinking that I should find a way to make the form for editing the feed more generic... one field, two fields etc.
For example, it could use token for a simplified format instead of the regex... EG: "New post: [title][link]" or in your case, "New post: [title][link-shorten]".
I think this will belong in a 2.0 version rather than messing with 1.0, since the storage for the feed is likely different.
I'll try to get something up before Drupalcon. *tick* *tick*
Comment #4
alienseer23 commentedgiving it a try! thanks!!