<< Home

403 error when content is not public

Use this forum for issues related to TriniTronic's Nice Article Tweets Plugin.

Moderator: jamesSBT

403 error when content is not public

Postby cliffers » Tue Mar 09, 2010 3:44 pm

Many of my articles require registration to view. The URL sent to tinyURL returns a 403 error unless the user is already logged into the website. I need this to go through the login redirect before going to the article.

example:
URL sent to tinyURL works if logged in, but returns 403 if not logged in:
http://www.mysite.com/index.php?option= ... 8&catid=39

but if the article URL were used, it would go to login redirect first
http://www.mysite.com/index.php?option= ... &Itemid=56


Great product.
cliffers
Lithos
Lithos
 
Posts: 3
Joined: Tue Mar 09, 2010 2:48 pm

Re: 403 error when content is not public

Postby Michael » Tue Mar 09, 2010 3:48 pm

I sent you some alternate versions of the plugin that should resolve the issue.

~ Enjoy!
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2478
Joined: Thu Aug 14, 2008 12:30 am

Re: 403 error when content is not public

Postby cliffers » Tue Mar 09, 2010 6:01 pm

I changed to the fullURL version and that fixed the issue. However, when saving the article, I get the following error (even though it does generate the bit.ly link twitter post and it does work with no 403 issue)
Image
cliffers
Lithos
Lithos
 
Posts: 3
Joined: Tue Mar 09, 2010 2:48 pm

Re: 403 error when content is not public

Postby Michael » Tue Mar 09, 2010 7:07 pm

right, I haven't seen this error with the fullurl version, but I believe it.

Here is what happens with the official version and the cURL version of the plugin. After the "on article save" event, the title and URL of the article are retrieved by the plugin. The URL is sent to tinyURL and then returned shortened. All the characters in the shortened URL and the title are counted and added together. If the count exceeds 140 characters (twitter's limit) then the title is trimmed automatically to ensure a 140 character tweet length.

With the fullURL version of the plugin, the title and the full URL to the article are combined together and are sent to Twitter. Twitter automatically reduces the URL using bit.ly. Since the plugin never sees the reduced bit.ly URL it can't do a shortened URL character count. The solution then is to count the characters in the title. The title is then trimmed, if need be, to 100 characters before the tweet is submitted. This leaves a reserve of 40 characters for the bit.ly URL, which should be ample. With this version, it is very possible that the title (100 characters) and the raw URL exceed Twitters 140 character limit. Upon submission Twitter would send back a notice that the tweet was to long. And you would be alerted with an error message. After Twitter converts the raw URL to the shorter bit.ly URL, it recounts the tweet (which should now be less than 140 characters) and excepts the submission.

I would recommend you use the official release version or the cURL version. They are constructed in such away to allow for the plugin to maximize all 140 characters of the tweet, as needed.

~ Best regards.
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2478
Joined: Thu Aug 14, 2008 12:30 am


Return to Joomla: Nice Article Tweets

Who is online

Users browsing this forum: No registered users and 1 guest