Latest Event Updates

SPARK Lessons

Posted on Updated on

Using Spark for my Databases class. Will post updates on lessons I learn. For now http://spark.apache.org/docs/latest/quick-start.html is a great source to get started.

Advertisements

Indri Passage Retrieval

Posted on Updated on

Coming soon…

Fostering Sustainability using Social Media

Posted on Updated on

Why is sustainability important:

After the industrial revolutions and modernization, the world population has been struggling less to get the basic jobs done. Luxury and Lavishness has become a part of regular man’s life. Everybody wants comfort and more. Everybody wants to look good. As a result of all these, excessive consumption is happening. The video below is from the now popular storyofstuff.com and reinforces the pattern of increasing human consumption.

Video on Excessive Consumption

Do Social Factors influence this phenomenon?

People’s sustainable behavior is highly dependent on social factors. If everybody around you is jogging everyday early in the morning, then you will probably also do the same. As the video also shows, Consumption in the western/developed countries is way above what it is in the third world countries. So clearly social and cultural factors influence the way people think and consequently what they buy and how they consume. So I hypothesize that Social media can be used as a long term tool to influence people to consume in a sustainable manner.

Using Social Networking for Sustainable behaviour:

A movement has to begin and continue propagating. Civic engagement and Collective action are possible through social media. Mathew Heck in this article-  http://techchange.org/2013/07/02/social-movements-and-social-media-spark-a-movement-change-the-world/ argues that “social media has fundamentally changed the way that governments, nonprofits, companies, universities, and individuals interact with each other and with their communities.”  There are numerous instances to exemplify this. India was shaken by a huge anti-corruption movement for a duration of more than a month and it is an ongoing movement. This was spearheaded by the ardent Anna Hazare who went on a hunger strike demanding the passing of the Jan lokpal bill to institute measures against corruption, which is rampant in India and greatly responsible for its economic downfall. There are also examples of such movements from Ukraine, Egypt etc.

There are no doubt a number of NGOs and Non-profit organisations with their own websites, blogs, discussion forums and facebook pages where they propagate several good things like Educating the poor, Women empowerment, environmental protection and so on and so forth. But these are not targeting the minds of people. These are not engaging enough for the existing audience to be sufficiently motivated and remain the same nor are they attracting new audience. A lot of them seem to be stagnating after a point. This could be changed. Active involvement has to be propelled. Can social media fundamentally affect the thinking of a person so that his/her habits and way of life change? If so to what extent? These are some questions that are food for thought. If simple online presence is not working, may be they could be some in-person meetups and activities.

Setting up OAuth for Twitter API

Posted on Updated on

1. On logging in to twitter’s developers’ website (https://dev.twitter.com/apps) and creating an app, I received the key and secret as follows:

Access level Read, write, and direct messages
Consumer key nIEpbVLzcEJpCmj0HuVY0A
Consumer secret HcofB6Np6xqmsDeCiJLKP5REiOBb6onpaWebAtGPc
Request token URL https://api.twitter.com/oauth/request_token
Authorize URL https://api.twitter.com/oauth/authorize
Access token URL https://api.twitter.com/oauth/access_token
Callback URL http://127.0.0.1:8000/twitter_callback
Sign in with Twitter No

2. Running the script by opening the twitterAuthTest.php file on browser.

[http://www.rashmiumd.altervista.org/twitter2/twitterAuthTest.php]
It displays all my tweets in the following format:

name (time stamp) <line break> tweet

Eg:

 Rashmi Sankepally (Tue Nov 26 19:32:44 +0000 2013)

Welcome to rashmiumd’s Portal | rashmiumd’s Portal http://t.co/xE5FGAGYzc

3. Commenting out the statements that set the Authorization Token and Authorization Secret gives the following error:

Fatal error: Uncaught exception ‘Exception’ with message ‘Could not authenticate you’ in /membri/rashmiumd/twitter2/Twitter.php:509 Stack trace: #0 /membri/rashmiumd/twitter2/Twitter.php(797): Twitter->doCall(‘statuses/user_t…’, NULL) #1 /membri/rashmiumd/twitter2/twitterAuthTest.php(14): Twitter->statusesUserTimeline() #2 {main} thrown in /membri/rashmiumd/twitter2/Twitter.php on line 509

4. Even when the authorization key is not valid, the same error is reported:

Fatal error: Uncaught exception ‘Exception’ with message ‘Could not authenticate you’ in /membri/rashmiumd/twitter2/Twitter.php:509 Stack trace: #0 /membri/rashmiumd/twitter2/Twitter.php(797): Twitter->doCall(‘statuses/user_t…’, NULL) #1 /membri/rashmiumd/twitter2/twitterAuthTest.php(14): Twitter->statusesUserTimeline() #2 {main} thrown in /membri/rashmiumd/twitter2/Twitter.php on line 509

5. On running the script – twitterAuthTest2.php file on browser, the following things happen:

It redirects me to: https://api.twitter.com/oauth/authorize?oauth_token=QhoINbboRv1LG0jzBqxQJz6ViOPw2zq3re7Szg7PLKs and asks me for authorization

Capture_twitter

Each time I open twitterAuthTest2, it uses a new oauth_token in the address bar.

After I logged in and authorized it, it redirects to:

http://www.rashmiumd.altervista.org/twitter2/twitterAuthTest2.php?oauth_token=QhoINbboRv1LG0jzBqxQJz6ViOPw2zq3re7Szg7PLKs&oauth_verifier=MU0oWeN3io4rTaDYn78o4BsGaBw2IfoDrsGLL1IKQ

So on authorizing, it automatically generates a oauth_verifier on the fly without having to put it in the code.

On authorizing, again the page with all my tweets is displayed as in part 2.