A beginner’s guide to twitter brand sentiment analyser

download (38)

In this article, we will look at how to build a basic brand sentiment analyser.

We will be building an application which will fetch running stream from twitter filtered for specified brands, try to categorise the emotion in postive or negative bucket, and compare total sentiments summary across brands.

This application will be built in nodejs, using sentiment module to analyze the emotion behind the post.

Setup:

  1. Register on Twitter developer platform and create a new application.
  2. In “Keys and access token” section, note consumer key and consumer secret. We will use it to authenticate our requests later.
  3. Install nodejs, if not done already. There are plenty of guides online on installation part.
  4. Install express (command: sudo npm install express -g)
  5. Create a new folder and initialize express module by filling relevant information (command: express)
  6. Step 5 should create a package.json file in your work directory, Open it in your favourite editor and add following dependencies: debug, sentiment, twitter. Your file should look like this: 
  7. Run npm install to install dependencies.

Now lets dive into coding part

Here is gist of code that I came up with while building this application

Feel free to reach me out for any query related to above.

Image credits: Animal NewYork

Bash quick tips

Bash quick tips

Screenshot-from-2014-02-13-000039

Here are few of bash command to save your time or increase productivity

1. Autocomplete ssh machine names

If you often ssh remote machines, this autocomplete for ssh will work well for you.

How to use? Append this to your bashrc file (~/.bashrc).

2. Git branch name, a permanent member of your shell

3. To find Union, Intersection and difference

4. To update environment variable of a running process

5. To create patch files

 

EDIT: Here is my complete bashrc

 

Email tracking in Gmail

Email tracking in Gmail

internet-spy

Ever wondered if someone is looking at your mails? Are you expecting a reply and are unsure if mail was even read? Do you send mails to large number of persons and want to know when they read it? Or Are you simply in love with latest update of whatsapp which let you know delivered and read time for your conversation?

 

If Answer to any of the above question was yes, Keep reading.

But wait, I don’t know how to code (or don’t want to code in case of a developer)!

You don’t need to do anything, All functionalities are provided out of the box.

804 Easy to Use

 

This is done by Streak, An add-on which merges nicely with Gmail interface and let you track all your emails effectively and efficiently right from your native gmail interface.

From Streak’s website, 805 Who Uses Tracking

 

Hold on, I don’t want anyone to know that I am spying!

Streak works invisibly to all who receives your mails, with no change at all. It just adds a small pixel which sends data back to servers which is not visible to anyone. Full stealth!

Cool, What else does it offers?

Well apart from its basic functionality of email tracking, Streak is a personal CRM tool which provides functionalities like Snooze (inherited by Google in inbox), Tagging of emails, Delayed sending of emails and whole lot of feature right out of the box.

Give it a try and let me know if it helped.

 

 

Seamless copy paste between devices

Seamless copy paste between devices

copypaste-copypaste-everywhere

Let me ask you a question, If I ask you to send some text from your laptop to mobile, how will you send it?

I used to save it in my gmail drafts and then read that draft from mobile and than copy-paste it as required. A friend of mine used to do it via bluetooth and other used to click picture of it via her phone camera (yeah, girls!). It was a long and irritating process till PushBullet came up with this concept of seamless universal copy paste. Yes, Now you can copy it on your laptop and paste it directly on mobile.

That Sounds awesome! How much do I need to pay for it?

Zero bucks. Yeah, its available for free.

Cool. But How?

Pushbullet-640x401

Initial Setup
  1. Install PushBullet app on your mobile phone: Available on Google Play store. Install it and activate Universal copy paste option in settings, if not done already.

  2. Install Chrome plugin or Mozilla plugin as per your browser preference.

And thats it. Once enabled, just copy on one device and paste on another. It will work across devices like magic with no extra steps!

 

Superb! Now what?

Apart from obvious use of this functionality to transfer small texts from one device to other, it can also be powered with other freely available apps like Word Snitch which allows you to find meaning of word by copying it. Combining its power with pushbullet’s universal copy paste, you can find meaning of any word by just copying it on your system and its meaning will pop-out on your mobile instantly.

Is there anything else?

Yeah, PushBullet prime functionality isn’t just copy-paste across devices. It is to mirror notifications across devices. Future is all about connected devices!

internet_connected_devices

Source: Pushbullet blog

Know something cool to share? Reach out!

Wireless adb debugging

Wireless adb debugging

images (2)
In my attempts to make terminal clients of whatsapp and paytm, I was consistently asked that if we had to connect it via USB, there is not much fun. So I made this entire experience wireless. This article will explain how to do wireless adb debugging over a network.

What do you need?

  1. Connectbot app: To power wireless connection over ssh.

  2. Adb setup: Use this google guide to set this up.

  3. Same Wifi network for phone and laptop.

 

Lets do it.

  1. Note down ip address of your system. (use ifconfig on linux).

  2. Open Connectbot, Enter your username@hostname for ssh field.

Screenshot_2014-09-28-16-31-43

You should be able to connect to your system terminal after basic authentication clearance.

  1. Long press your newly made connection and select Edit host. Inside Post login automation, add this

adb connect localhost:5555

Screenshot_2014-09-28-16-41-40

ensure to enter an extra [ENTER] after this command and press ok.

  1. Again go back to your connection, long press it and select Edit port forward this time. (Yes, We are going to use port forwarding to make it wireless)

Use settings button to add new port forward and enter this

Nickname: ADB

Type: Remote

Source Port: 5555

Destination: localhost:5555

Screenshot_2014-09-28-16-42-02

save the settings and mobile part is done.

  1. Connect your android to system and enter below command to allow tcpip on 5555 port for adb.

adb tcpip 5555

And you are done. Go wireless now and type adb devices on your system. you should see something like this.

Screen Shot 2014-09-28 at 4.39.54 PM

 

Now go out and try Wireless terminal Whatsapp and Seemless mobile recharge via Paytm.

The great Indian contradictions

The great Indian contradictions

India, Where every one wants his country to succeed, but no one wants their neighbor’s success. Here are a few other popular Indian contradictions..

 

Irony is when People kill their own girls in womb and seek out neighbor’s girls for ‘Kanya Puja’!!!

6

You have to look both ways to cross a one-way road.

3

Parents want their children to stand out in a crowd but expect them to do what the crowd is doing.

Coach stage

The Hindus have to prove that they are secular, while the Muslims have to prove that they are patriotic.

Ganesha-chaturthi

Everyone’s in a hurry, but no one reaches on time.

5

In India YOU do not cast your vote, you vote YOUR caste.

Abu Abraham Vote Your Caste Here

Where  education loan has higher interest rate than car loan.

download (5)

You can’t be a peon in any organization without 8th pass but you can be Chief Minister / Prime-minister / President of our country without any education, even with a proven criminal track-record. .

15

Students with 45% get in elite institutions thru quota system and those with 90% get out because of merit.

Reservation1

We live in a system where people who post on social media gets imprisoned while the rapists and murderers roam freely.

facebook-in-prison

 

Do You find any great indian contradiction? Share it with us.

Paytm AndroidTerminal – Seamless recharge via linux

Paytm AndroidTerminal – Seamless recharge via linux

download (4)

In continuation to my previous attempt to control Whatsapp via command line (If you haven’t read that, Please do before continuing), This guide will allow you to recharge your mobile number via command line using Paytm.

 

Prerequisites:

With all prerequisites as in previous guide still valid (including Android phone attached via data cable to Linux machine), couple of additional ones are

  1. Paytm app – Download here.

  2. A logged in user with paytm wallet balance – Yeah, this guide is not a free recharge guide and will be using Paytm cash from user’s account.

Terminal Commands

1. To unlock your phone

adb shell input keyevent 82

If your phone is locked, this command will unlock it for you. For those who are using screen-locks, it can also be automated but it is again beyond scope of this tutorial.

2. Open Paytm app

As we did for whatsapp, we can open paytm app via stop-start machanism to ensure it to work even though it was open already.

adb shell am force-stop net.one97.paytm
adb shell am start -n net.one97.paytm/.AJRHomePage

3. Ask Recharge number

After reading the recharge number, Tap on recharge number coordinates (270, 650) found by hit and trial.

echo -n "Enter Number:"
read number
adb shell input tap 270 650
adb shell input text $number

4. Ask user for amount he wants to recharge with.

Similar to Number, Tap on coordinates for amount and fed the desired amount in it.

adb shell input tap 270 1050
echo -n "Enter Amount:"
read amount
adb shell input text $amount

5. Get the recharge done

Now to proceed further, you need to tap on back button once to remove keypad screen and then press on Proceed buttons and subsequently tapping on pay with path cash button.
adb shell input tap 270 1850
adb shell input tap 270 1350
adb shell input tap 270 1450
adb shell input tap 990 1650
adb shell input tap 990 1650
adb shell input tap 990 850

6. Close the Paytm app.

Echo a thanks message before closing the app.

echo "Thank you for recharging with Paytm AndroidTerminal \m/"
adb shell am force-stop net.one97.paytm

 

PS: If your android phone is connected to internet via a slow connection, you might need to add appropriate sleep command to make it work.

This entire experience can be automated by saving below commands in a file

adb shell input keyevent 82
adb shell am force-stop net.one97.paytm
adb shell am start -n net.one97.paytm/.AJRHomePage
echo -n "Enter Number:"
read number
adb shell input tap 270 650
adb shell input text $number
adb shell input tap 270 1050
sleep 2
echo -n "Enter Amount:"
read amount
adb shell input text $amount
adb shell input tap 270 1850
adb shell input tap 270 1350
adb shell input tap 270 1450
sleep 2
adb shell input tap 990 1650
sleep 2
adb shell input tap 990 1650
sleep 2
adb shell input tap 990 850
echo "thank you for recharging with command line paytm \m/"
adb shell am force-stop net.one97.paytm

Save it in a file named paytm and make it executable with global access. Now next time you need to recharge, Paytm CommandLine will be at your service.