You are on page 1of 12

GSOC DRUPAL PROPOSAL

PERSONAL INFORMATION
Name:
University:
Graduation Date:
Major:
Location:
Email Address:
Freenode IRC Nick:
Resume:
Github:
Drupal.org Profile:

Project Title:

Umar Ahmad
Jamia Millia Islamia University, New Delhi, India
June 2015
Computer Science and Engineering
New Delhi, India (UTC +5:30)
ahmad.umar2009@gmail.com
umar-ahmad
http://goo.gl/osbfVe
https://www.github.com/gleek
https://drupal.org/user/2836505

fluxpocket (Pocket integration


for Fluxkraft)

Abstract:
Integration of Pocket service (getpocket.com) for the Drupal Fluxkraft distribution.
fluxkraft is a module suite and distribution for automating your social-media workflows!
Connect and automate tools like facebook, twitter, flickr and dropbox or schedule tweets
to promote your website content! It is an OpenSource alternative to services like IfTtT,
Zapier or Cloudwork. For really becoming a usable alternative more and more services
should be integrated to Fluxkraft.

Detailed Description:
The main goal is to build a module for integrating the Pocket API in the fluxkraft
distribution for Drupal 7. In addition that project can be an example for revising the
existing Documentation should be revised to add to better support future service
integrators.
As a result of the project there should be a Drupal module that adds Pocket functionality to
fluxkraft. For example making it possible to retrieve and post articles to Pocket, filtering
stored items by tag and adding and removing tags to items.
The documentation shall be updated to support other developers for implementing new
services, like Youtube, Github, Yammer and co.

Technical Details:
The main challenge is to use the existing fluxkraft services to create a module which
covers all the aspects of getpocket api which may include the add, modify and retrieve
facilities of the API.
Since no documentation of the fluxkraft services are available, one of the main
aspects of the project is also to include and update the documentation so that developers
may easily integrate services such as Youtube, Github, etc using their APIs.
But for the time being, code of already established fluxkraft services such as that of
Dropbox, Facebook, Flickr, feeds, Linkedin, xing and twitter will be used as a reference to
create the module.

What work has been done?


I have already made a curl implementation of getpocket api which can be found on
https://github.com/Gleek/sample-getpocket-api. This app currently only uses the ADD
aspect of getpocket API. This is only a simple demonstration of interaction with
getpocket-API which can be extended easily to cover all the aspects of API.
This app currently includes a generic API which can be used to
Some of the main boundations getpocket API are:
1. Authentication over HTTPS connection.
2. Using POST method as GET method is currently not supported.
3. Using either urlencoded format or json format.
Therefore the operations are done in a sequence of:
1. Authentication
a. Request:
POST/v3/oauth/requestHTTP/1.1
Host:getpocket.com
ContentType:application/jsoncharset=UTF8
XAccept:application/json

{"consumer_key":"1234abcd1234abcd1234abcd1234",
"redirect_uri":"pocketapp1234:authorizationFinished"}

b. Response:
HTTP/1.1200OK
ContentType:application/json
Status:200OK


{"code":"dcba4321dcba4321dcba4321dc"}

2. Receive Callback
The redirect url is sent via the request in the authentication method.
3. Use the code and the consmer_key to get access token
a. Example Request
POST/v3/oauth/authorizeHTTP/1.1
Host:getpocket.com
ContentType:application/jsoncharset=UTF8
XAccept:application/json

{"consumer_key":"1234abcd1234abcd1234abcd1234",
"code":"dcba4321dcba4321dcba4321dc"}

b. Example Response
HTTP/1.1200OK
ContentType:application/json
Status:200OK

{"access_token":"5678defg5678defg5678defg56",
"username":"pocketuser"}

4. Make Authenticated Request to the get-pocket servers


(Example ADD request)
POST/v3/addHTTP/1.1
Host:getpocket.com
ContentType:application/jsoncharset=UTF8
XAccept:application/json

{"url":"http:\/\/pocket.co\/s8Kga",
"title":"iTeaching:TheNewPedagogy(HowtheiPadisInspiringBetterWaysof
Teaching)",
"time":1346976937,
"consumer_key":"1234abcd1234abcd1234abcd1234",
"access_token":"5678defg5678defg5678defg56"}

In case of FluxKraft
In the case of fluxkraft I will have to use the guzzle service to interact with the API.
The project has already been started as an Experimental project on drupal and I have
cloned it on github https://github.com/Gleek/fluxpocket, and started working on it.

The Basic Proposed Structure of fluxpocket Module

The above chart represents a module structure tree to be adapted for the mentioned
module.
The main getpocketclient.php defines Guzzle driven services for Pocket API
The Plugin directory contains the files which work upon the Guzzle services defined in
getpocketclient.phpto receive the tokens from the API. The function should be as follows:

public function client() {


$service = $this->getService();
return PocketClient::factory(array(
'base_url' => "$this->serviceUrl/v3",
'consumer_key' => $service->getConsumerKey(),
'consumer_secret' => $service->getConsumerSecret(),
'token' => $this->getOauthToken(),
'token_secret' => $this->getOauthTokenSecret(),
));
}

The Rules directory specified contains the file for Integration of RULE-API namely
RulesPluginHandlerBase.php which basically contains a class
abstract class RulesPluginHandlerBase extends FluxRulesPluginHandlerBase

which initializes the default values , and a function:


public static function getServiceParameterInfo()

to get and set the value of Parameters.

INFORMATION REQUIRED BY DRUPAL


Resume: http://goo.gl/osbfVe

Preferred time of day for virtual/video interview: 1200 UTC -2000 UTC
Open Source Experience:
I have been contributing open source code for more than two years, I have participated in
various Hackathons and FOSS events in India and have been a member and manager of
Jamia Millia islamia University -LUG (Linux Users Group) and a founding member of Google
Developer group JMI chapter.
GSOC INFORMATION
Have you participated in Google Summer of Code in the past? If so, for Drupal? If not,
for which organization? Please describe your participation in Google Summer of
Code.
No, This is the first time Im participating in GSOC

Are you applying to any other organizations this year? If so, please explain.
No, Im currently only concentrating on this project.
How many hours will you devote to your GSoC project each week? What are your
other summer plans?
Ill devote full time on the project, and will give more than 40 hours/week as stated by
google during the summer.
Ill be having my semester-end examinations from 1st -19th May 2014 so I may not be
able to give complete time during this period, but will cover-up my work during the
summer-break.
Have you registered an account at Drupal.org and joined
groups.drupal.org/google-summer-code?
https://drupal.org/user/2836505 and yes, I regularly follow the gsoc drupal group

Have you ever worked with Git?


Yes I have been using git for a while now. Ive participated in various hackathons across
the city and used git to manage the code between the team members. Ive used github,
heroku and bitbucket as hosting client for git.

Question based on knowledge of git


You just committed some code (and not pushed yet), but you realized there is a typo
in commit message. How would you change it (please explain each step of the
solution)?
git commit --amend -m "New commit message"
which will amend the tip of current branch with a new commit message
there can also be other simple workaround such as:
Another Method:
git reset --soft HEAD
then commit with new message.
If a particular commit has to be changed it can be done by viewing
git log
git rebase -i HEAD~$num #For bash
where $num is the commit difference from the current HEAD

Have you ever utilized IRC?


Yes, I have used IRC and am well acquainted with it. Being the manager and member of the
Linux-Users-Group and Google-Developers-Group association of our college, I also have
some experience moderating IRC channels of #jmilug, iitdlug.
I have also been on IRC of fedora-project and gsoc other than that of drupal-google.
It's required that you complete "Drupal Ladder for GSoC Students" before applying.
Please provide evidence.
Yes, I have completed the Drupal Ladder and I can say it is very helpful as a kickstart
tutorial towards contributing drupal. The evidence can be seen as my contributions in the
form of reviews in Drupal. https://drupal.org/user/2836505/track
Here is the link to patch I submitted in the Drupal8 Sandbox Queue (as the Drupal Ladder
instructed ) https://drupal.org/node/2212783

Have you ever contributed code to Drupal?


Yes, only recently I have started my contributions to Drupal. My current contributions
including reviewing patches. Ive also started building Drupal 7 modules
I have made two drupal modules:
Simple Testing Module which focuses on forms API and use of AJAX and User Verification
It can be found at https://github.com/Gleek/drupal_test_module
Drupal snowfall module which creates a snowfall effect on any drupal website
It can be found on https://github.com/Gleek/drupal_snow_fall

LIVE DEMOS CAN BE FOUND AT : http://engineerinme.com/umar/drupal/


I have also started the fluxpocket module for Drupal which is still in development
the existing code can be found on https://github.com/Gleek/fluxpocket

Do you plan to continue contributing to the Drupal project after GSoC is finished?
Yes, I have been a drupal-user from past year and I think its high time to actually
contribute to the community. GSOC is just a platform for me to get into the Drupal
community and I will surely be an integral part of the community even after GSOC
Have you ever built a Drupal site or helped on a Drupal project?
Yes Ive had experience with Drupal. Ive built jmilug.org (currently offline)along with other
members of the group,
Ive also built a website for a startup named knowacollege, currently the site owners have
sold the domain.
Ive also solved some errors on our college website built on drupal (jmi.ac.in)

Almost all my projects are open source and most of them can be found at
http://www.github.com/gleek.

My projects in the domain of web-development include:


Electrical Bill Management System-https://github.com/Gleek/bill-management
This web-application provides a platform for Electrical Companies and their
customers to manage their Electrical Connection. The main features were
complaint forum, online payment, dynamic, beautiful yet simple UI
Farmer Information Service-https://github.com/Gleek/data-hack
This App provides services for farmers by giving them the current pricing of
crops/fertilizers in or near his area. Main Features are:
IVRS System to help farmers with no internet access.
Estimation of Crops Cost in coming future (Data-Mining)
Representation of complex data through graphs for easy understanding
GPS through Phone Message https://github.com/Gleek/gps_through_sms
This App helps users to use the navigation system of Google-Maps through a
simple SMS, without requiring any GPS or internet service.
SMS Quiz: https://github.com/Gleek/sms_quiz
This App was made to run in an audience through a projector . The questions
changed every 60 seconds and the people have to message their answers on a
specified number. The person with most number of correct entries wins the
competition.

Question based on given 'almighty_function'


You have this function:
function almighty_function($x, $y, $z) {
if ($y != $z && $x == $y && $x == $z) {
return "Success!";
}
return "FAIL!";
}

The values can be as follows


$x=true
$y=3#anynumbergreaterthanzero
$z=5#anynumbergreaterthanzerootherthan$y

The reason for that while using comparison operator with one operand as bool and the
second operator is anything else, the second operator is typecasted into bool. For any
number greater than zero is turned to true. In order to avoid such errors, condition for
identicality should be used:
if ($y !== $z && $x === $y && $x === $z)

This will cause the function to return false

Timeline:

19 May:

Community bonding Period, Learn more about Drupal community, Interact


with my mentors and do research

26 May:

Make Authentication Work complete with Pocket API

02 June:

Cover up a basic task (such as ADD) using fluxkraft

09 June:

Integrate this basic Model with RULES API, thus creating a basic working
model.

16 June:

Buffer Time ( Clean up and Test code, fix bugs )

23 June:

Mid term submission

30 June:

Implement Other Aspects of POCKET API (MODIFY, RETRIEVE)

07 July:

Modify the RULES to accommodate these Aspects

14 July:

Make Interfaces and Improve overall design

21 July:

Research Other,already established, fluxkraft services(for documentation)

28 July:

Write up a raw documentation

04 Aug:

Polish up the documentation

11 Aug:

Clean up code, write tests, improve documentation, etc.

18 Aug:

Final submission

Mentors: derhasi, aschiwi


Difficulty: DIFFICULT
Which aspect of the project idea do you see as the most difficult?
The main challenge is to cover up all the aspects of fluxpocket API using the existing
fluxkraft infrastructure.
Which aspect of the project idea do you see as the easiest?
The easiest part is I think the portion of documentation. Though no documentation is
available the available code should be enough for writing up the documentation. Since this
will be first time Ill be writing any documentation I slipped this part towards the end of
the summer.
Which portion of the project idea will you start with?
Since I have already made a CURL implementation of the getpocket API. The first main
challenge in front of me will be to implement the same idea using the existing
infrastructure of fluxpocket.
How will deal with project, task, and time management? Will you utilize software? If
so, which tool and why?
Ill be tackling the project as specified in the timeline. As far as any software is concerned
Ill be using eclipse IDE with PDT and Drupal Plugins.

About Me
I am Umar Ahmad a 3rd year undergraduate student from India. I am currently studying
Computer Engineering at Jamia Millia Islamia University, one of the premier universities of
India. I am well versed with PHP, Python, C and C++, with many projects in each of the
languages.
I have been fascinated by Open-Source and FOSS culture ever since I heard of them,
in the first year of my college. And ever since then Ive been continuously taking steps to
be an integral part of the community.
My fascination towards Open-Source made me to join the Open-Source community
of my college JMI-LUG. Today Im a managing member of JMI-LUG and one of the
founding members of GDG-JMI(Google Developer Group JMI subchapter).
Currently, me along with the other members of JMI-LUG are organizing our third
Annual Developer Conference named BootConf which aims at the prevalent open-source
technologies of today. Other than that Ive been delivering lectures to people and students
who are newer to the Open-Source community to help them realize importance of the
FOSS and encourage them to join the community.
Apart from this Ive been also taking part in various hackathons around the city,
where my teammates and I create a minimum viable product in a span of 24 to 48 hour.
Among these are the projects such as GPS through SMS in which I stood second amongst
other developers across the city.
Farmer Information Service , which was proposed in data-hack hackathon (The first
hackathon initiative by Government of India) and many more.

Why this project ?


Almost a year ago one of my friends acquainted me to IFTTT. They had a brilliant service
to connect any two technologies on the internet without any hassle with already prepared
recipes. I quickly searched for any Open-Source Alternatives only find an app, made by
drunomics, which had a very limited support and no documentation to extend.
Recently when I was browsing through the GSOC projects of Drupal I came across a
project of this very app. On further researching I found out that drunomics has made some
new services which were enough to be used as a base for other services. Thus, this became
my chance to actually build an app which I wanted and I signed up for this project.

You might also like