Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#136 2011-02-14 16:48:57

zeusdidit
Member
Registered: 2007-10-16
Posts: 111

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Dear MonkeyNinja,

First I wanted to say thank you for your plugin and I had a small request.

Every so often I find that my URL’s get truncated due to apostrophes or dashes or I just feel like creating shorter and friendlier URLs. So I’ve been editing the URLs a bit using the TXP URL-only title area in the Write Tab.

Generally my process is to save an article without publishing it to Twitter to make sure it looks right and the URL’s work favorably. Once the article is checked it gets posted twitter.

I was hoping that if I save an article first and I use the URL-only title that it would in turn create a tiny.url using that URL information but it keeps using the information from the Post’s Title.

Any lucky chance this would be possible? There’s a couple of options I can think of.
1. Can you point me to where in the code I can change that information for just my site.
2. Check what the URL information is being used.
3. Give the user a Drop Down to choose Title or URL-only title as which tiny.url to use to create.

If it’s possible great. Let me know your thoughts and again many thanks for your great plugin.

Many thanks,
Zeus

Offline

#137 2011-02-14 18:47:21

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

zeusdidit wrote:

Dear MonkeyNinja,

First I wanted to say thank you for your plugin and I had a small request.

Every so often I find that my URL’s get truncated due to apostrophes or dashes or I just feel like creating shorter and friendlier URLs. So I’ve been editing the URLs a bit using the TXP URL-only title area in the Write Tab.

Generally my process is to save an article without publishing it to Twitter to make sure it looks right and the URL’s work favorably. Once the article is checked it gets posted twitter.

I was hoping that if I save an article first and I use the URL-only title that it would in turn create a tiny.url using that URL information but it keeps using the information from the Post’s Title.

Any lucky chance this would be possible? There’s a couple of options I can think of.
1. Can you point me to where in the code I can change that information for just my site.
2. Check what the URL information is being used.
3. Give the user a Drop Down to choose Title or URL-only title as which tiny.url to use to create.

If it’s possible great. Let me know your thoughts and again many thanks for your great plugin.

Many thanks,
Zeus

Hi Zeus,

I thought this was working, but perhaps I am mistaken. What version are you using?

The URL gets set in the arc_article_tweet method using Textpattern’s very own permlinkurl method (line 730 in the dev version). Maybe this isn’t working as I expected, but I thought I had been successfully building URLs.

Andy

Offline

#138 2011-02-14 22:24:55

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

I came by to mention the same problem — when I publish an article with an apostrophe, the tinyurl breaks. For example:

Article name: 2011 Women’s Memorial March
Article URL: http://aaronhildebrandt.com/blog/2011-women-s-memorial-march
TinyURL: http://tinyurl.com/4ly7ns4 > http://aaronhildebrandt.com/blog/2011-womens-memorial-march

As you can see, TXP adds a hyphen where is apostrophe is supposed to be, whereas arc_twitter just removes it. This is in 1.0.4 on 4.2.0.

Offline

#139 2011-02-14 23:33:49

zeusdidit
Member
Registered: 2007-10-16
Posts: 111

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Andy,
I’m using version 1.0.4 on 4.20, same as ashground. Can I test your new release?

Offline

#140 2011-02-18 14:11:14

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,566
Website GitHub Mastodon

Re: TXP Tweet: arc_twitter and arc_twitter_intents

@ashground

Why not simply amend the ‘URL-only-title’ field in your article so it matches the tinyURL version? I’d say it’s more a textpattern core problem than an arc_twitter problem that apostrophes are turned into hyphens in URLs.

Last edited by philwareham (2011-02-18 14:11:46)

Offline

#141 2011-02-18 15:03:00

zeusdidit
Member
Registered: 2007-10-16
Posts: 111

Re: TXP Tweet: arc_twitter and arc_twitter_intents

in total agreement with Phil…!

Offline

#142 2011-02-19 04:03:52

ashground
Member
From: Vancouver, Canada
Registered: 2005-01-07
Posts: 63
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

I’d rather not have to double-check the URL field every single time I post an article. Here’s a quick, albeit untested, hack to fix it:

Find this:

$url = permlinkurl($article);

and replace it with this:

$url = permlinkurl(str_replace("'", "-", $article));

Offline

#143 2011-02-19 12:42:47

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Just been doing a couple of quick checks to see if I can recreate the issues being experienced by Zeus and ashground and can confirm that I’m getting the same issue. As Phil has suggested the problem seems to lie with Textpattern’s core rather than arc_twitter. The method being used by arc_twitter is the one used by TXP to build the permlink.

If I set the ‘URL-only-title’ field before a URL title has been generated and save, then the TinyURL will also be wrong; but so is the TXP ‘View’ link next to the title! It seems that Textpattern isn’t observing its own rules here.

ashground wrote:

I’d rather not have to double-check the URL field every single time I post an article. Here’s a quick, albeit untested, hack to fix it:

Find this:

$url = permlinkurl($article);

and replace it with this:

$url = permlinkurl(str_replace("'", "-", $article));

I’ve given ashground’s suggestion a quick test and it does fix the particular issue arising from apostrophes, but not other issues around respecting the URL only title. Perhaps one of Textpattern’s core developers could shed some light on why permlinkurl doesn’t work in the article edit screen so that a more robust fix can be added to the plugin, and sort the ‘View’ link out.

@Zeus, I’ve been testing this in the current dev version and I’m afraid it doesn’t fix this as explained above. However, I am planning on getting a new release out some time this weekend that you will be able to try. Most of the new features are to do with extra TXP tags to play with, like a new Tweet button.

Offline

#144 2011-03-03 18:04:36

vurt
Member
Registered: 2010-10-22
Posts: 50

Re: TXP Tweet: arc_twitter and arc_twitter_intents

If arc_twitter is set to publish automatically will it publish if an article is first saved in draft mode? And then publish when the article is made live?

Offline

#145 2011-03-03 18:51:37

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

vurt wrote:

If arc_twitter is set to publish automatically will it publish if an article is first saved in draft mode? And then publish when the article is made live?

Currently no. When you’re ready to update your Twitter account you need to make sure that “Update Twitter” is set to yes and then save your article in a published state.

I’ve added it as a “feature request” to the plugin’s issue tracker on Github. There is a fair amount of code changes required to make this happen so no guarantees when this feature will get added.

Offline

#146 2011-03-03 20:14:37

vurt
Member
Registered: 2010-10-22
Posts: 50

Re: TXP Tweet: arc_twitter and arc_twitter_intents

OK, so I can work on an article draft, and if “Update Twitter” has been set to “Yes” all along, then it will publish to twitter only when the article goes live.

Is that correct?

Offline

#147 2011-03-03 20:47:16

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

vurt wrote:

OK, so I can work on an article draft, and if “Update Twitter” has been set to “Yes” all along, then it will publish to twitter only when the article goes live.

Is that correct?

No. Sorry, but when you are ready to post to Twitter you have to select “Yes” update Twitter. After the first save of the article, if Twitter is not updated the radio buttons switch to “no”. As I said in the last post, this may change in a future release but will require a bit of work to get it to do this.

Offline

#148 2011-03-03 21:40:45

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

vurt – are you wanting to make sure it will not inadvertently publish a draft article if it is set to yes?

Last edited by maverick (2011-03-03 21:41:10)

Offline

#149 2011-03-04 17:35:39

vurt
Member
Registered: 2010-10-22
Posts: 50

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Yes exactly. Will it?

Offline

#150 2011-03-15 08:56:08

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: TXP Tweet: arc_twitter and arc_twitter_intents

Andy, I am getting a badly formed code error with the latest Beta v.2 version from your site – do you have a compressed copy?

Offline

Board footer

Powered by FluxBB