iMacro in action with APIs

Hello there, I know it’s been a long time since I am posting something new out here. Anyways, I am here and let’s start with something cool.

Today, I am going to open a whole new domain of possibilities where you can actually use your iMacro code for doing cool this; things that cool developer dudes (nerds) do often and charge a huge amount of money for that. ,, wait,, what’s coming ahead? Is it like some computer language tutorial or some cheap selling campaign? Well, not exactly, today’s section focuses upon utilization of iMacro scripting (simple scripting) for doing complicated activities without understanding or actually going through lengthy processes .

I am sure you must have heard of API, it’s a common term these days; it’s a fancy name given to a technique used for data/information transformation from one website to another. Let’s say you want to talk to your twitter account from your website, what will you do for it? Twitter allows standalone interface where you can login, see and send tweets and much more but what if you want to add this functionality in to your website so that whenever there is a news update from your company, it should get updated at your twitter account. Now, this is the place where API comes in to action; twitter, just like thousands of other website allows this functionality using its public API where you get free access to their API by registering and blah blah blah, oh crap, there are a bunch of tutorials out there, go and Google it yourself. As I said earlier and as you already know from my previous posts that I only share solutions that a common men can do (of course basic understandings of iMacro is must :P) so lets see how it is done.

There is a website called ‘www.apigee.com’, it’s a platform where you can actually access thousands of APIs of different websites including all of your favorite social media platforms. Today, we are going to see how easy it is to send periodic tweets using iMacro combined with apigee functionality; you will have to register a free account first and once you login, you will land at their home page with list of API’s that they have in their inventory, you can add more however let’s just stick with already listed ones. Now go through the lists and click ‘twitter’:

 An API allows interaction with the parent website and each API has different functions, as in our case, it allows getting data like tweet counts, friend lists, changing data from timeline, re-tweeting, posting a new tweet and many more functions, you must be seeing all these details if you’ve been following me.

Since you’ve got basic idea, let’s go for the real part where you actually link an API. There is a menu called ‘Console’ at the top, click it and click Authentication select box and select ‘OAuth 1’, it will show a popup, asking you to login your twitter account and allow it’s access to API, just hit ok/yes/authorize button (you know). Here I have allowed access to mine:


Now click “Select an API method” and select ‘Update.json’:



Now type the actual tweet text and click “Send” button:


And that’s it, go check your twitter account, you have actually posted a tweet using Twitter API :P

Keep in mind that twitter has limit of 160 characters, you can’t post a long tweet.

There are thousands of other APIs, some are listed at apigee and rest are more like personal however you can still utilize them using apigee if you have access to them. Here is the code for sending bulk tweets using iMacro:

VERSION BUILD=8920312 RECORDER=FX
'
'    Instructions:
'    Create a file in datasource folder, named Tweetsfile.csv; first row contains header and there is only 1 column
'
CmdLine !DataSource Tweetsfile.CSV
Set !DataSource_Columns 1
Set !Loop 2
Set !DataSource_Line {{!Loop}}

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:request_params ATTR=ID:apigee_console_0_status CONTENT={{!Col1}}
TAG POS=1 TYPE=BUTTON FORM=ID:console_request ATTR=ID:send_button
TAG POS=1 TYPE=A ATTR=ID:control_request_params
Wait Seconds=3

And more scheduling auto-tweets, checkout my previous post about scheduling iMacro scripts!
Readmore → iMacro in action with APIs

Tumblr - how hard it can be for automation

Let me assure that as you are here, you must be aware of Tumblr.com right?

Tumblr
Tumblr Micro-Blog
OK, for those who are new to Tumblr, let me just go through little details about it and then we come to main point of this article. Tumblr is a microblogging platform and social networking website at same time; it was founded by Mr. David Karp and later purchased by Yahoo Inc. (David would be happy to see his product purchased by Yahoo!) - Tumblr allow it's users to post multimedia and other content to a short-form blog and likewise it's a social cum blog platform, it possess basic features provided in both platform including LIKES & Re-blogging.

People are crazy with social media platforms, always looking for new methods and trick to automate everything around and social media platforms are already aware of this scenario and they aren't much bothered as eventually it's increasing their audience however not all the platforms have same mentality, Tumblr being one of them. Mr. David was happy with these spammers or aggressive users however Yahoo doesn't seem to give them free hand, just like their Email platform (Oh! I don't like fancy html codes by Yahoo, making it harder to go around and automate things). Since the takeover, they have been putting more and more complex backend code for making it a smart micro-blogging solution with least spammers (I am not a spammer, I do it for fun only :P ); with advanced jSon/jQuery and other fancy work, they have added a WYSIWYG Editor called "ACE Editor" which is a good feature for users since it has a lot of features just like MS-Word however if you are looking to automate posting using iMacro, this is a huge problem since iMacro doesn't recognize this editor and doesn't record most of the time that it would record normally. Working with ACE Editor require some backend knowledge about it and how it works, there are way around or tricks to add/remove text from the sessions that it created while active however Tumblr make it difficult to operate this widget while at their platform - I spent two days in finding a standard function that ACE Editor would normally call for getting/setting data and eventually ended with bunch of complex functions and triggers, this and that!

For those, who are planning to reverse code Tumblr code and get to ACE Editor and do modification through Java Scripting, I got an advice "Don't do it", it isn't worth trying if you haven't done this before.

Crux of above articles: Tumblr is difficult to code with iMacro until and unless you are too smart. I made a script recently, it take URLs from CSV file, open these URLs, click RE-BLOG button, clear all texts from comment/schedule sections and fill them both with new data from CSV before hitting Schedule button.
Readmore → Tumblr - how hard it can be for automation