Monday, October 19, 2015

Rolling Up the Twitter Tweeter Fetcher

The problem is how to get Tweets to wherever you want them to go even when the target isn't set up to receive them.  Facebook makes linkage between Twitter and Facebook relatively easy.  Contrarily, Google+ does not so how is all that Twitter wisdom to get there.

Note:  the reason Google+ does not is because it's so charming when those which are ostensibly the biggest and most sophisticated networks get as provincial as country preachers about who can go where.

So, the Twitter Tweeter Fetcher is working for fetching the last twenty Tweets back from Twitter.  The question now is what's the best way to get them to Google+?

Here's a sample of the file it creates:

Item: Mon Oct 19 22:40:50 +0000 2015
Tweet: Benghazi panel sparks feud among Republicans - Enjoy the BBQ as they put Trey Gowdy on the spit. About time. https://t.co/q8ajZRwLV0

Item: Mon Oct 19 22:35:58 +0000 2015
Tweet: Ithaka Blog: Earth Was Live Much Sooner Than Originally Thought: Scientists have announced life has existed on... https://t.co/2zEXUxX24d

Item: Mon Oct 19 19:22:42 +0000 2015
Tweet: If drug addiction were treated like other diseases my son might be alive today | Patty DiRenzo https://t.co/iRqrk0T6cK

Item: Mon Oct 19 18:51:09 +0000 2015
Tweet: Ithaka Blog: Gloria Steinem is an Admirable Woman ... But She is Wrong on Clinton: Gloria Steinem is one of th... https://t.co/WXEXKRmyKc

Item: Mon Oct 19 17:54:09 +0000 2015
Tweet: Ithaka Blog: Earth Art - Image of Australia from Space by Scott Kelly: Contemplation(not the artist's title) http://t.co/mScaCmDaqa

Item: Mon Oct 19 17:46:49 +0000 2015
Tweet: Facebook comes up with yet another twist to extorting your cellphone number out of you. DO NOT DO IT! http://t.co/stdrt50LJY


The listing is exceptionally rough but that aspect is minor because the important thing is the flow of it.

The easiest solution is when that output is created when I open a Web page for that purpose.  The file can then be transmitted in the same step to the blog either as a file or an email.  When that content gets to the blog, it will automatically be made available in Google+ although they will only see the title of Twenty Pithy Tweets from Silas or some such.

A more elaborate solution would be to invoke it as a cron task via Unix on the web server.  Cron is a timer when kicks off actions at pre-programmed times.  This is preferred because it's automatic and I don't have to do anything except configure it.

More to consider on the final stage but progress is good so far.


Here's an excellent resource and don't get put off on it by the title:  Build Your First Twitter App Using PHP in 8 Easy Steps

The steps are clearly written and the sample code needs no modification beyond adding your Twitter account name and some other information.

Note:  the above output is not the same as will come from the sample code because I have stripped out information which I did not consider useful for what I want to do.

No comments: