Get Facebook comments with large user pictures

On the /user edge, user pictures url are not returned by default, and when users ask for it, the response image is not in biggest format. This query should get the largest user pictures associated with post : /user{picture.type(large)} There are other use cases where this syntax applies as well get comments of a feed /feed?fields='from{picture.type(large)}' get feeds of an user /userid/feed?fields={from{picture.type(large)}} Examples tested with Facebook Graph API > v2.0, using Graph Explorer and PHP SDK.

Continue ReadingGet Facebook comments with large user pictures

A glance at FOSSASIA Calendar API

I am a frequent user of popular social platforms API : Facebook, Twitter, Instagram.. Among others, Facebook Graph API is the API I’m most familiarized with, and despite its lack of documentation, Graph API makes me from time to time admire the engineering mind of those who built it. It’s simple, has a clear design, and communicates a consistent philosophy. I inspired a lot from it to implement Calendar API, a simple web service at FOSSASIA. Why naming it API, and not web service ? I don’t know, I was always confused about the two, and as far as I concerns, they are the same. The only difference might be the word ‘web’ that tights web service to HTTP, and the scenario involving two distant machines, while API is somewhat more general (an API call of an in-app library for example). This is my first time building a web service, and so far there wasn’t any technical challenge : it’s just simple & straightforward PHP script with echo $results; in the end. Mainly because the hard part is still ahead : getting people to know about it, and maintaining it while there are (hopefully) enough clients who care to yell at API developers when they do something wrong. The API I built supposed to parse the merged ics file of all communities event feeds, and expose it to users, in various formats, with filters and options. Don’t worry if the last sentence doesn’t make sense. We’ll dive in the details right away. There are currently two possible formats : .ics and .json. Users set the format with format parameter, for e.g. format=ics. ics format is suited for developers who want to import events to their calendar app / wordpress plugin. json format is for front-end developers who want to build a web / mobile web without the hassle of parsing ics feed. A few filter parameters are possible to refine search results : source to filter by community, from, to to filter by events time, limit to limit number of events returned, and fields to custom select event fields. Finally, sort parameter is to order the results by certain criteria. Currently only datetime ordering (ascending or descending) are available. As I said, the Calendar API is inspired a lot from Facebook API. Those are the ideas I pickpocketed from their design : multiple values parameter. With source and fields, multiple values can be provided, separated using comma. fields parameter. The motivation for event field filter is because the event has lots of different fields, and different users are interested in different information. There is also the “linked edge” characteristic of Graph API that I find very interesting : connection between related data make them more useful. It is done that way mainly because the API reflects Facebook own data model, but there is nothing thats prevents unconnected data to be presented in a connected way. So I’ll hope to implement something similar for FOSSASIA Calendar API in the futur. (Right now the API serves events from Freifunk community, not FOSSASIA, mostly because there are not enough event feeds from FOSSASIA community to collect. So if you want to help us,…

Continue ReadingA glance at FOSSASIA Calendar API

Basic UI implementation for Event app

I am enjoying this a lot. It has been a wonderful experience till now working with all my team members and my mentors. I mean I am learning something new everyday. Like I have learned squashing git commits using rebasing and pushing, which I am using a lot now. I am also following a code review policy suggested by mohit where I push to a new branch on my fork and then create a PR, after which mohit reviews my code and then merges it. This is a very nice practice and I think that every open source developer should follow such practices to get the best quality code out there. Moving on, this week I was mainly working on implementing the UI for the app. For this I studied layouts of various apps and came out with what I though was best. So I though I should implement the Tracks Fragment First where I add all the tracks I have updated inserted into the database in a recycler view. I take up a very basic layout for now just showing the track name and description. I also added the sponsor fragment where I have used Picasso by Square Inc. to download the Logo images and displayed them in a recycler View. Here also I researched various options to download the Sponsor Logo images and I come up with one clear winner : Picasso. We can resize image, load from URL’s,drawables etc. all in just one line of code. I also added the speaker fragment in which I used a bit complex layout as I had to get the speaker image, name, designation and description all in one recycle view ViewHolder. So after some hiccups I managed to get it right. I used Picasso here as well for the speaker Image. Although I still have to add further details to this fragment and the others. I’ll do so in this week. I am planning on adding some material design with some clickables for different holders. I have also started to work on a list of cardviews as well.

Continue ReadingBasic UI implementation for Event app

Knitting Library to support numerous Knitting Machines

Hi everyone, I'm Shiluka Dharmasena, Computer Science and Engineering undergraduate from University of Moratuwa, Sri Lanka. Thanks very much for this great opportunity to get involves in FOSSASIA open source project and I’m keen to give my fullest contribution to the FOSSASIA.  For GSoC 2015, I am developing a library to support knitting machines. It's great to work with FOSSASIA team under awesome mentors Mario Behling and Christian Obersteiner. This is the Initial suggestions for the project. Library to support knitting machines Basic abstraction of the library to create library as separate layers Serial communication : open, configure, read and write to serial port Machine definitions : machine initialization, load to machine, save from machine Image handling functions : memory allocation, read image file, setter and getter for image pixels File handling functions : read / write access Common utility functions Add dependencies for the library There are several dependency libraries which ayab has such as pillow, pyserial, wsgiref, fysom and yapsy with relevant versions. These dependencies should be added to the library. Functions for the library For access hardware directly * Identify existing libraries to interface with hardware * Use libraries to deal with serial ports * Ability to get all the functions via library (for an example functions in ayabControl.py and add more functions to support in more machines) * Ability to send QT signals Emulate file formats * Create functions to emulate file format Add Arduino support Installation Installation should be well documented in step by step. Additionally I suggest to add GUI based installation with usability improvements with standard installation procedures. * Installation on Linux (32bit, 64bit) * Prerequisites * Setup * Installation on Windows (32bit, 64bit) * Prerequisites * Setup Tests on the library Use a python test framework like unittest to test the python library. It supports test automation and aggregation of the tests into collection. Documentation of the library Documenting Class definitions, methods definitions and links to the given source codes.

Continue ReadingKnitting Library to support numerous Knitting Machines

Open Event Management Application: An Exciting Beginning

So, let me describe a little more about the project. We call it ‘Open Event’, and we aim to make it a easy to use solution for all Open Source (or otherwise) event/conference/seminar/workshop organisers to be able to host data about their sessions, speakers, tracks, and be able to show this to the attendees using a Webapp and an Android App.

Continue ReadingOpen Event Management Application: An Exciting Beginning

searchQuick Apprise: TWO #GoogleSummerOfCode #FOSSASIA

The intended “searchQuick” (sQuick) is an application to enable a user to search a set of books or texts, like an encyclopedia, or some other topical book collection offline built in the open source platform Pharo 4.0. After building various mock-ups for a user friendly graphical interface for the application, the rudimentary features which would be present in the first release were finalized. The chief features would include : Search for word(s) Browse files in the current image Help or Tutorial About section Feedback or Suggestion Aid Explore the code ( Cardinally Open Source ;) ) LATEST MOCK UP OF GUI FOR sQuick At this moment, the most viable options available (apart from the use of GTSpotter, Rubric or Bloc suggested by developers on the forum and #pharo IRC) include: The use of Spec to build the UI which provides a comparatively easier option to implement Button Click Actions, User Input Search String Retrieval etc. But the graphical interface designed by placing the widgets is not a very fancy one and dependent on the current theme of the image. The Morphic GUI gives the application a very pretty look in comparison, however the user input search string retrieval method is not a straight-forward one and is under construction. After considering various pros and cons, the suitable alternative is considered to be the one made with Morph as it gives a refreshing look to the application. UPCOMING: Completion of GUI development Commencement of Index build Stay tuned for more... Post any queries , will be happy to help :)

Continue ReadingsearchQuick Apprise: TWO #GoogleSummerOfCode #FOSSASIA

Starting with Smalltalk, Pharo and Spec

It’s been a few weeks since I started with Smalltalk, Pharo and Spec. Under the guidance of Mr. Martin Bähr, Mr. Sean DeNigris and people from the #pharo community (@thierry, @kilon, @maxleske) I have been able to learn Pharo in a systematic way. I have implemented the knowledge gained by building a few simple desktop applications using the resources available online. This post intends to clear all your doubt regarding the basic definitions of Smalltalk, Pharo and Spec. GETTING THE BASICS CLEARED Smalltalk is an object-oriented, dynamically typed, reflective programming language. It was designed and created in part for educational use, more so for constructionist learning. The language was first generally released as Smalltalk-80. A Smalltalk environment is its own little world, designed around a conception of a computer with a minimal operating system and populated with living objects. A Smalltalk implementation is composed of an image (binary code), a major source file and a 'changes' file. The image is called Virtual Image (VI) because is independent form the platform you use for running Smalltalk. Smalltalk systems store the entire program state (including both Class and non-Class objects) in an image file. The image can then be loaded by the Smalltalk virtual machine to restore a Smalltalk-like system to a prior state. As Sean DeNigris wrote to me: “You may not realize it, but you have opened a portal to some of the greatest minds in the history of our industry. You have in your hands, not a programming language, but a live, dynamic, turtles-all-the-way-down environment designed to provide 'support for the creative spirit in everyone'. More practically, Smalltalk is a programming tool that allows productivity unimaginable in most systems. And, if you put in enough time and effort to actually think in it, it will help you program better in any language you use.” ; Smalltalk is more dynamic and powerful than what one can think of. Pharo is an open source implementation of the programming language and environment Smalltalk. Pharo is not Smalltalk. Pharo is Smalltalk-inspired. Pharo offers strong live programming features such as immediate object manipulation, live update, and hot recompilation. Live programming environment is in the heart of the system. Pharo also supports advanced web development with frameworks such as Seaside and more recently Tide. The official Pharo website defines it as: Pharo is a pure object-oriented programming language and a powerful environment, focused on simplicity and immediate feedback (think IDE and OS rolled into one). Pharo relies on a virtual machine that is written almost entirely in Smalltalk itself. Spec is a simple framework for describing User Interface (UI) for Pharo Smalltalk. It takes a model and a layout description, runs it through an interpreter and a UI is produced as a result. All the widget implemented this can then immediately be reused as any other widget. It also allows the separation of concerns between the different parts of the user interface as expressed in the MVP pattern. Spec emphasis the reuse of the widgets as…

Continue ReadingStarting with Smalltalk, Pharo and Spec

Adventure developing an Open Event Application

My adventure with the FOSSASIA organisation developing an Open Source event application has begun. I'm working in multicultural team and I feel very excited. It's quite funny that while you are working, your team sleep. Our mentors of Fossasia are very helpful (@mariobehling and @dukeleto). Duke is a real magician. When I ask him for help, I find a solution before he response to me :) But the truth is that When I've got a problem, they always try to show me a good direction.   Our application is intended to create events in a quick and comfortable way. It will have the ability to manage multiple tech conferences. Every user will able to see the latest conference in Web App or Android app. So in general we are triple team. Each of us is responsible for another part. Manan is responsible for Android application, Arnav for Web App while me for server which supplies an Api to Android and Web App. I guess that cooperation in our team is good! I greatly get along with guys.

Continue ReadingAdventure developing an Open Event Application

searchQuick Apprise: ONE #GoogleSummerOfCode #FOSSASIA

The intended “searchQuick” (sQuick) is an application to enable a user to search a set of books or texts, like an encyclopedia, or some other topical book collection offline built in the open source platform Pharo 4.0. In the inceptive coding period of this project development the tasks achieved are as: Designing the basic graphical user interface using Morphs in Pharo 4.0. The morphs elements utilized to make the interface elements included: - TextMorph for labels etc. - PluggableTextMorph to display the contents of the file - ImageMorph for background, header GIFs etc. - TextMorphForEditView to enter the search string. - SimpleButtonMorphs for creating buttons whose click will perform the desired action. - MenuMorph , MenuItemMorph to make the list of files available as 'Browse' menu. - DropListMorph to make a drop down list menu for the selection of languages. Loading the files in the current Pharo image and making methods/classes that would directly access those files from the image and display their names as a menu list Making a Metacello Configuration of the project for easy project loading in Pharo. For further ease, the project configuration was directly added to the Meta Repo of Pharo 4.0 at SmalltalkHub.com and now the project can be directly loaded through Configuration Browser in Pharo 4.0                   World > Tools > Configuration Browser > sQuick(jigyasa) Removing the cache of the instance of the MainInterface so as to allow the users to open up many search/content windows simultaneously Making of a content window that would display the file name and the file content when the file name is clicked from the 'Browse Files' menu Designing mock-ups for the UI for an enhanced user interface which include the latest search engine feel UPCOMING: Augmenting the UI for a pleasant user experience Initiate working on the search tool / indexer build. Stay tuned for more... Post any queries , will be happy to help :)

Continue ReadingsearchQuick Apprise: ONE #GoogleSummerOfCode #FOSSASIA

Calendario: Another JS calendar library

Calendario is a lightweight calendar library that I happen to find on the net. Their approach to calendaring solution is rather unique : it’s not a full-blown library like jQuery FullCalendar where everthing is ready to be used. With Calendario, calling init function simply generates plains html source code. The styling part is completely up to user. Another plus is it’s lightweight (350 lines of code more or less). It’s easy to dive into the source and make advanced adaptations to specific use-case. But what’s really remarkable is their examples. As I said the styling is out-sourcing to user, and they provide stunning examples that demonstrate how to do it. For me (a developer “designing” stuffs), readily beautiful examples are a crucial selling point. But (there’s always a but..), Calendario is very poorly documented. A pointer to the same blog post all over again is not enough ! I was very confusing about how things work at first, especially about the data model. This blog contains what I found out (rather painfully) about Calendario library : Initialization <div id="calendar_id"></div> <script> $('#calendar_id').calendario(options); </script> Available options Option Purpose* Default weeks weekday labels [‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’] weekabbrs weekday short labels [‘Sun’, ‘Mon’, ‘Tue’, ‘Wed’, ‘Thu’, ‘Fri’, ‘Sat’] months month label [‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’] monthabbrs monday short labels [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, ‘Dec’] displayWeekAbbr display week short labels false displayMonthAbbr display month short labels false startIn 1 fillEmpty true zone ‘00:00’ events [[‘click’], [focus’]] checkupdate true weekdays ‘MON, TUE, WED, THU, FRI’ weekends ‘SAT, SUN’ feed http://calendario.t15.org/sync/ month year caldata calendar events data Most of them you can safely ignore, I enlisted them all for the sake of completeness. Checkout the next section for interesting ones. Option format caldata A list of json objects. The list’s keys and values contain following information : key : the event date in MM-DD-YYYY format value : an array of event values that occured on the given date. Each case of the array can have following fields : Option Purpose Value type content title of the event string url Link to event page string note added note for the event, will be included in the html as inside tag string startday string, in MM-DD-YYYY format endday string, in MM-DD-YYYY format allDay true for all day event boolean Examples var events = { '06-06-2015' : [{content: 'Important Meeting at 4', startTime: '04:00', endTime: '06:00', note : 'Everyone please gather at Markketing Department'}], '06-07-2015' : [{content : 'First event of July 7', allDay : true}, {content : 'Second event of July 7', allDay : true} ], '07-01-2015' : [{content: 'All day event', allDay: true, note : 'So loongg !'}] } Wrap-up : Pros and cons of Calendario Pros : lightweight fully customizable design beautiful examples Cons poor documentation lots of work undone, not recommended for those who want a powerful library that just work That’s about it ! Found something wrong, or just want to help completing this unofficial…

Continue ReadingCalendario: Another JS calendar library