This is the website of Andy Carter a Textpattern and Drupal web developer living in the Steel city.

Give TXP Tweet 2 a test drive - alpha release of arc_twitter available

The next big release of arc_twitter (TXP Tweet) is really coming together now so I thought it was time to release an alpha version of the new plugin.

The focus for version 2 of arc_twitter is very much on the front-end side of things with the introduction of a load of new tags for your Textpattern templates. Most importantly the ability to retweet articles using the new Tweet button Twitter released the other week.

The new <txp:arc_twitter_retweet /> tag will add Twitter's Tweet button to a page; when used on an article page that you've tweeted via arc_twitter then your tweeted text is used for the tweet. It works as both a single and container tag. All of Twitter's existing configurables are available as attributes.

Unfortunately, using Twitter's button can seriously reduce your page load time. It's a bit like injecting that infamous fail whale into your site. It seems to be a known issue and there's not a lot that can be done about it. However, you can set include_js="0" in the tag to just output a retweet link without needing to connect to Twitter (the downside being you lose the tweet counter).

Other new tags included in this alpha release make use of the information stored about articles you've tweeted via the plugin:-

<txp:arc_twitter_tweet /> - this will output an article's tweet (inc_url="0" will remove the shortened URL from the output)

<txp:arc_twitter_tweet_url /> - this is the URL to the article's tweet on Twitter (a single and container tag)

<txp:arc_twitter_tweet_tinyurl /> - this will output the shortened URL used for the tweet (a single and container tag)

More tags are to follow before version 2 gets an official release. These will mainly be to improve the existing two tags and address some requests I've previously had.

One small change in the back-end is the use of cURL for URL shortening courtesy of johnnie from the Textpattern forums (thanks).

Current known issues that will be addressed prior to a stable release:-

  1. Tweet dates in <txp:arc_twitter /> and <txp:arc_twitter_search /> are incorrect
  2. Query strings ignored in URL linking
  3. <txp:arc_twitter_tweet /> doesn't link URLs yet (not really an issue, just not done yet)

If you do download and install the alpha version be warned that it is still very much in development and there is no documentation (other than that on this page) to support the new functionality. I plan on giving the documentation a proper rewrite for version 2 to reflect all the new tags being made available. There may also be changes to tags/attributes between the alpha and more stable releases.

It is probably best not used on live site's for the time being, if you want to deploy arc_twitter you're probably best off with version 1.

So if you're ready to brave it, here's the alpha version of arc_twitter v2 for download.


Comment

  1. hi drmonkeyninja.
    Great to know that there are more goodies for arc_twitter coming down the tube.
    Will try to give it a spin on a client’s site.

    I think I’ve requested this before, at TXP forum probably.
    Do you think it could be possible to extend txp:arc_twitter to have some basic search (or better said, “filtering”) functionality?
    Let me try to explain it better: I think it could be useful to list user’s tweets, while at the same time, filtering them.

    In code:

    <txp:arc_twitter username=“drmonkeyninja” search=”#textpattern” />

    That would output tweets by drmonkeyninja that used the #textpattern hashtag.
    This could be useful for listing different streams of tweets by topic.
    So, here in your site, in your articles related to Textpattern, you could have a sidebar list with all your tweets related to Textpattern.

    If the idea has some merits, but you are not sure, alternatively, this may be better if implemented in <txp:arc_twitter_search />, maybe?

    In code:

    <txp:arc_twitter_search hashtag=“textpattern” username=“drmonkeyninja” />

    Not sure if the idea is appealing, and if so, if any of the two suggested implementations (on txp:arc_twitter and/or txp:arc_twitter_search) has some drawbacks that I’ve not considered (maybe the Twitter API doesn’t let you do this kind of filtered queries by user?).

    Julián Landerreche · Tue Aug 24, 08:50 PM

  2. Hi Julián,

    Twitter’s API won’t let you do this for a personal timeline. However, it can be done with the search API and is already achievable with txp:arc_twitter_search! You could achieve your example above with the following:-

    <txp:arc_twitter_search search=“from:drmonkeyninja” hashtags=“textpattern” />

    Unfortunately Twitter’s search is a bit limited at times and doesn’t always return a lot of results as it only seems to search the most recent tweets. When testing the above tag I just got 1 result, but I know that I use the #textpattern tag a lot.

    I’ll add a ‘user’ attribute to txp:arc_twitter_search for version 2 anyway as it seems that it would make it easier to use. Thanks for the suggestion.

    Andy Carter · Thu Aug 26, 05:48 PM

Commenting is closed for this article.