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.

  • 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.

  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.
  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

  • 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 

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