Monday, 30 June 2014

Week 6 : Unagi

Previously I had directly used methods provided by the content repository to search for specific NodeTypes embeded deep inside a parent Node.This week I embarked to use FlowQuery and Eel to locate the specific Nodes.Eel or the Embed Expression Language is a domain specific language which provides a good interface for solving complex expressions.the only way EEL could be used inside a Flow Package(PHP) was through FlowQuery.On a side note the title of this Post comes from Unagi a Japanese fresh water eel.

Progress:
  • Twitter posting now includes a link to the page and shortens any text if it exceeds the character count i.e 140 characters.
  • Facebook and Twitter Override methods were drastically improved by using FlowQuery to find the content nodes for a Page.
  • Page posting for twitter is now enabled which works in a similar manner to Facebook Page Posting and grabs the most appropriate headline/text node in that page for the content of the tweet along with the link to the page.

     
  • I built a simple logging interface to ease development ,this shows the errors with access tokens or any such  important messages.this system is good only for development purposes.

     
Issues Faced:
  • Learning Eel was more complicated than I expected it to be. 
  • Had some issues with newer versions of facebook sdk.had to revert to 4.0.1
Next weeks goals:
  • Next week I intend to tackle the behemoth Image grabbing and posting.
Please post some suggestions if you have any idea on how to improve this project.
Follow Progress GitHub

Friday, 20 June 2014

Week 5: Tweet Tweet



Well,I started off this week with the goal of finishing off with Facebook Connect and moving on to Google Plus,I did finish off with Facebook but Google Plus disallows automated posting as of now and I coudn't think of any legal way to post automatically to Google Plus,So I decided to do Twitter and it went like a breeze.

Progress last week:
  • Wrote functions to find a node of a particular type nested deep inside a page,the function works almost perfectly but fails when it encounters a NodeType content collection(teaser).With this Publishing a Page with Facebook will mean that it finds the first headline and uses it as the content for the post,and text for description and the remaining paramters are taken from the page.
  • Working with twitter went like a dream,I used a third party API(codebird) which was really well documented and the best part is that twitter access tokens never expire.
  • After configuring the SDK the remainder of the process was quite similar to Facebook so within no time I could post from my Neos instance to my wall on Twitter.



Issues Faced:
  • Google Plus:Google Plus allowed posting of moments which require you to share the post manually to have a public visibility,which defeats the purpose of automated posting.
  • Getting a verified Twitter developer account took me a day since they don't do mobile verification in India,I had to write to the customer support to get read/write access.
Next weeks Goals:
  • Sharing links/images in the tweet.
  • Tweeting a page.
  • Preparing a tutorial on how to set it all up.
Please post some suggestions if you have any idea on how to improve this project.
Follow Progress GitHub

Sunday, 15 June 2014

Week 4 : Override

I dedicated week 4 to build a system such that irrespective of the nodetype considered socialConnect should support it just by small additions to the .yaml file,and larger changes can be tailormade by writing a sub-class which extends the pre-existing override methods.

Progress:
  1. On Communicating with my mentors I was convinced that a checkbox system for the inspector is more suited and is more functional,Hence I changed the code to support checkbox in the inspector and property type was set to boolean.
  2. Instead of having a class(FacebookHelper class) which gets the values of the Facebook post parameters directly,I opted for an indirectly approach where in a base Override class(FbOverride.php) exists which is a default override class for Facebook.
  3. I have added NodeType specific classes for Headline and Page which extend FbOverride but add features of their own,this inclusion required me to write a Factory class(FacebookFactory.php) to generate the right object for a NodeType.
  4. Suppose a new page is created(Download section for neos demo site)and it is shared via socialConnect.The override class(FbPageOverride.php) automatically finds the page name,page link and the headline/text nodetypes and assigns it accordingly to the facebook post parameters as shown.

    here headline becomes the content of the post,the page title becomes the Link title for the post,the text element becomes the description and the caption is queried from the settings.yaml.
  5. Another challenge was providing the link to the page ,now any node published the link to the page will be found and will be conveyed to the facebook post.
Issues:
  1. For now the above features don't tend to work seamless on all pages and cases,some debugging is required .
  2. handling images to facebook post is tricky from a local server . 
Next week goals:
  1. Debug and make fetching text/headline work seamlesslly for all cases and scenarios. 
  2. wind up on Facebook Connect.start Google Plus.
Catch this project on Github  or packagist

Saturday, 7 June 2014

Week 3 - UI and advancements

Tension is rising as the midterm evaluation is nearing(23rd June) with my original mid term goal being to finish Social Connect for one social networking site and deploy it for testing.
      I started off last week with the intention of displaying messages on completing of posting/failure but the absense of a framework to do so has put that on hold for now.

Progress for last week:
  • Updated the Facebook Post method to take captions,descriptions and images into consideration, as of now images and description are pre-defined in a yaml file and only the content is fetched from the Node,and posted onto Facebook.
  • For now,the headline NodeType is fully supported and the Inspector UI has been modified for that and a select box is made to select a channel for publishing.

  •  There is an option available to use defaults for name/caption/description for the post or methods can be written to override these defaults as per user discretion.
  • This Package is now available on Packagist repository and can be downloaded easily by adding a line in the composer.json

Issues:
  • Posting exception messages in the interface is still not done.
  • deciding on which node type to consider and handling complex node types.
Next week Goals:
  • Handling complex Nodes like Pages,Chapters etc and image handling if possible.
  • Wind up on Facebook and start working on Google Plus by the end of the week. 
Follow this on https://github.com/hybridNeo/rahul.socialConnect 

Sunday, 1 June 2014

Week 2 - Connect

The second week began with me tackling some issues regarding instantiating objects of library files,figures out that i had an mal-aligned doc block which was causing the problem pointed out by the wonderful community ofcourse,after i fixed that things starting falling in line and the progress was smooth as butter.

Progress this week:

  1. First things first,at the time when i started this project Facebook PHP SDK 4.0 was just released and was kind of unstable,But around the last week on May,It had become stable so i deceided to migrate to this better version of the SDK.Which provided more classes and more functionality than the previous one.
  2. I was able to connect to the Facebook services whenever my publishing process generates a signal,and it would post the content of the selected NodeType onto a Facebook page/wall specified.

  3. And the settings regarding Facebook access such as URL,appid etc are stored in a separate settings.yaml file to provide better security.
  4. With respect to the new privacy policy of Facebook it is almost impossible to get an infinitely valid access token.But with respect to Facebook Page which the user is an admin of it is easy to get the access token which lasts forever,i have highlighted all steps to achieve this on the Readme of the Github repo of this package.
  5. Exception handling also done with respect to API calls.
Issues/Problems experienced:
  • I was unable to figure out about the messaging framework of Neos/Flow.
Next Week Goals:

  1. Display appropriate messages on posting to Facebook or display any exceptions.
  2. Analyze the content of the NodeType to check if it has child nodes and images should be considered also.
  3. Inspector UI for SocialConnect.
Follow the repository on https://github.com/hybridNeo/Rahul.SocialConnect

Friday, 23 May 2014

Week 1 - A new beginning

The official coding period for GSOC started on 19th May 2014.With regard to my Final Exams getting over on 23rd May,there was a very little I could contribute this week.But nevertheless the excitement level got me coding whenever I had free time.
Progress this week:

  1. Updated installation to dev-master,understood how composer works for downloading packages.
  2. Set up a Basic Flow Package with Slot Service to listen to the publishing process and write all the contents of the respective node.
  3. Used composer to download the library files of Facebook PHP SDK to the Flow Package.
  4. Set up Package.php for the Package to configure the wiring between signal and slot ,and other dependencies. 
Issues/Problem experienced:
  1. Trouble with enterprise level concepts of PHP likes Aspect Oriented Programming.
  2. Trouble initializing objects of library files in the slot.
Next week Goals:
  1. Set up objects of Facebook class in the slot service,and communicate with the Facebook SDK.
  2. Display appropriate messages in the backend.
  3. Handle Exceptions.
Follow the repository on https://github.com/hybridNeo/Rahul.SocialConnect

Monday, 19 May 2014

Google Summer of Code @TYPO3

Google Summer of Code was something I heard about in the summer of 2013,with some research about the program I was fairly motivated to apply for the 2014 season.It was February when I got serious thanks to some info sessions by some seniors at college who spoke about the program and its various perks.GSOC was like one of those double decker biscuits .First, we get to code for an open source organization which is amazing knowing the fact that open source is the way of the future,almost every software which is used from my Operating system on my Laptop/Mobile to the Media Players I used were all open sourced,It was high time I gave back to the system.Secondly, while people struggle to get internships at small companies you get to boast around with something that is sponsored by Google,and puts you on their payroll indirectly with a hefty cheque for a student.

My past skills in the field of computer programming included languages like C,Java and PHP,But PHP was my favourite language thanks to it's C like syntax and library support for tools.So while going through the Accepted Organization list found TYPO3 a popular Content Management System to be most suited for my skills.Immediately I contacted the mentors and went through the ideas page,within no time I had set up the working environment for all three flavours of the CMS and liked the futuristic Neos the most,One of the ideas was a multi-channel connector to simultaneously publish posts from the Neos installation itself.I tried building a plugin which would do the same and went through the code-base.One important thing I learnt was that in open-source the main challenge is reading and understanding code written by others.With this in mind and a couple of week of sleepless nights hanging out in the IRC I was able to write my proposal and submit it.

I was very happy when I came to know that my proposal had been accepted and now I had something productive to do in summer other than sleeping all day.I instantly got in touch with my mentors and set up all the required version control softwares and started work.

At the point of writing this post it is the first day of the coding period for GSOC and you can catch all the activity on Github link

I hope to have a productive summer for me and the whole Neos community.