Twitter Toolkit for LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intermittent Operation [fixed: Firewall blocking LabVIEW]

I'm having an issue where posting to Twitter via this API works only intermittently.  I can open the same VI, and change only the Tweet-to-post, and some times it will post the tweet, and sometimes it will not.  There are no errors reported.

I have generated new Access Tokens and Access Token Secrets, but (as expected) they were identical to the previously used values.

Any ideas?  Thanks.

-Joe

0 Kudos
Message 1 of 5
(9,696 Views)

Hey Joe,

That sounds like strange behavior. I have had the Twitter VIs poll the Twitter APIs for long periods of time with periodic posting without too many issues. Are you within the rate limits for the Twitter API? The VIs do not enforce a polling or posting rate limit so it is possible to go overboard: https://dev.twitter.com/docs/rate-limiting/1.1

We are migrating to v1.1 of the Twitter API soon but for now the i3-Twitter toolkit should be using the v1.0 APIs. Some other things to keep in mind are that the Twitter service will not accept duplicate posts but it should return an error in that case.

To troubleshoot the behavior you can monitor the <i3-Twitter>\SubVIs\HTTP Error.vi during execution to see what the response from Twitter is when a post seems to succeed but does not actually post correctly. It is possible that the responses from Twitter will contain some additional useful information:

Capture.PNG


Milan
0 Kudos
Message 2 of 5
(7,525 Views)

Hi Milan,

Thanks for the response.  I should be well within the rate limits.  I'm attempting to post tweets 1-3 times/day.  Immediately after a reported succesful tweet, I read back the newest tweet to verify that it matches (this is how I know it's not working properly).

The tweets are always unique.

I was about to post the Header and Body strings from HTTP Error.vi, but upon examining them I believe I found the issue.  During 'Post Tweet.vi', it appears the HTTP functions are being caught by my companies barracuda web server.  I didn't consider this before because posting would work some of the time, and because I can access the HTTPS version of twitter.com within a browser.

So I replaced http://api.twitter.com/1/statuses/update.json within 'Post Tweet.vi' and https://api.twitter.com/1/statuses/user_timeline.json within 'Get Tweets New.vi' with their HTTPS counterparts.  That didn't seem to break any connections, and it got around the web filter.  So as far as I'm concerned, this issue is resolved.

Is there any reason why using secure HTTP for posting and reading tweets is a bad idea?  Thanks.

-Joe

0 Kudos
Message 3 of 5
(7,525 Views)

Hi Joe,

Interesting that the firewall / web filter was only functioning intermittently; I am sure they would appreciate the feedback on the loophole haha

Using HTTPS is a fantastic idea but older versions of LabVIEW on Mac OS X did not support secure http connections so we chose the lowest common denominator at the time. The in-development version of the i3-Twitter API is being migrated to Twitter API 1.1 and already has a change that will check for SSL capabilities and use them if they are available. I completely agree that if the option to use HTTPS is there we should be using it.


Milan
0 Kudos
Message 4 of 5
(7,525 Views)

Hi Joe,

As a heads-up a new version of the Twitter Toolkit has been released that uses Twitter API v1.1 and includes usage of SSL by default if it is available on the platform. The features are available in Twitter release 2013-06-17 and can be downloaded on the homepage.


Milan
Message 5 of 5
(7,525 Views)