Mashape Developers NEWS

Geek shouts around the Mashape technology

mashaper

Apps like a Puzzle!
Build web apps from your favorite services, in minutes.


Sweet Home> www.mashape.com

mash me ;)

           
 

Your app now has automatically API.

 

Applications created on Mashape can be included into other apps created on the platform (see [Including shapes]), but their components (aka "shapes") can be also called from the outside using our API infrastructure.

This means that a published application has its own APIs and also the client libraries to call them using different popular technologies. For example, your app can be called from:

  • Web Applications
  • Desktop Applications
  • Native Mobile Applications
  • Wherever it's required

In a sentence, your app is programmable inside and outside Mashape from day 1!

 

You don't have to care about building the wrappers around the APIs, it's our job. And also, the Mashape Client libraries allow you to call any app on our platform. One library to rule them all. To start using the APIs, please go to the API - Getting Started document.

Posted
by mashaper
 

Mashape loves Trac

If you have seen our technology page on mashape.com, you know that we really love Open Source tools and today I would like to write some words on our internal use of Trac.

First of all, Trac is a web based project management and issue-tracking tool written in python. I started using Trac more than three years ago, when I migrated every project from CVS to Subversion in the company i was working with.

The power of Trac lies in some of its features: 
- basic system with planning (with milestone), documentation (wiki) and issue tracking 
- links between wiki, ticket and commit logs (I love this feature) 
- lot of plugins (for example we are using timing and estimation and XML RPC)

Using intensively a tool like Trac can really help a startup like ours to plan the product and keep the focus on it. 
Now that we have almost finished a first version of Mashape, we have tons of little tasks to do in different areas like tuning, code enhancement or visual stuff (css, images..) and it's important to organize them.

For example our typical scenario is:

Augusto: "Hey Mike, can we move this button from here to there?" 
Mike: "Of course.. but not now, i'm debugging this @#% component, open a ticket!"

When I've finished with the current task, I enter our Trac and accept the ticket Augusto opened, adding a time estimation. 
In this way everyone in Mashape knows what I'm working on (looking for "accepted" tickets of the current milestone). 
To achieve this result, I usually set in "accepted" status only one or two tickets (if they are strictly related) at a time. This has the notable side effect to help me to stay focused.

When I close the ticket, I add a short message describing the solution I've implemented and I commit the modified version with the ticket number in the commit message. In this way, for every ticket, I could see when the ticket was closed, which solution was implemented and which files where committed.

Another rule: when one of us opens a ticket, he has to be verbose if the ticket is for someone else, maybe attaching a file if it could help.

The last activity regarding our trac usage is our semi-random planning meeting, in which we try to define milestones, clear tickets (deleting duplicated tickets, improving description..) and assign them to the right milestone.

That's all folks, now I can close the ticket "write a blog post about Trac" :)

Mike

Posted
by mashaper
 

New mashape online: Fourwalla

Hello mashapers,

yesterday we got a new mashape, called fourwalla

This application is composed by three different mashapes:

1. the first is the Google Maps interface. It is composed by a single visual shape, that generates the HTML code needed to load an embeddable google map. It is the same application used in our first published mashape, flynomad. What is cool about that, is just the simplicity on how this developer has imported the Gmaps app inside fourwalla; less than a minute and without coding; copy and paste a little string of MIML and it's done.

2. the second is the Gowalla interface. It is written in PHP and uses curl and json to interact with gowalla's API.

3. the last is Foursquare interface. It is written in PHP too (we are still working on Ruby support). It's different from Gowalla's mashape because we had to use some regexps to parse the HTML code of foursqure website. The reason is that we wanted to have the same information extracted from both services. So it uses curl, json and regexp.

OK, but this is our developers blog, so I would like to share with you the PHP code that loads the list of spots around the coordinates provided (loaded via javascript from the google map)

 

function getNearestSpots($param) {
    $url = "http://api.gowalla.com/spots?lat=".$param->get_latitude().
        "&lng=".$param->get_longitude()."&radius=50";
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, 
           array('User-Agent: Mashape/01',
                    'X-Gowalla-API-Key: <key>,
                    'Host: mashape.com',
                    'Accept: application/json',
                    'mashape:<pwd>'
    ));
    $response = curl_exec($ch);
    $obj = json_decode($response);   
    $result = array();
    foreach($obj->{'spots'as $spot) {
        $res = new getNearestSpotsResult();
        $res->set_latitude($spot->{'lat'});
        $res->set_longitude($spot->{'lng'});
        $res->set_name($spot->{'name'});
        $res->set_image($spot->{'image_url'});
        $res->set_id( substr($spot->{'url'}, 7));
        $result[] = $res;
    }  
    return $result;
}


Isn't it nice? :)
It was developed and tested using vim and php, than it was uploaded on Mashape.com .. and now it works!

Mike

 

Posted
by mashaper
 

Mashape vs Programming Languages

As you may have seen, our platform is online with only PHP support.

We decided to start supporting a well-known language, but we are moving on: we have developed the platform to easily add other languages, and this is our direction!

The part of Mashape's backend that handle programming languages is pretty straightforward and is divided in different Maven modules: lang, lang-java and lang-php.

The first is the most important. It defines all the interfaces to be implemented and the Factory that loads at runtime the right set of classes to handle the particular language.

The second is our mock implementation, for internal use (only in test-cases and demos). It will be not available in production.

The third is the first language available to our users: PHP implementation.

Now we are fixing some parts of the platform and implementing some new interesting features, but the next milestone in our roadmap is the Ruby support.
Next supported languages? For sure Python and then who knows.. we could add Groovy!

Stay Tuned
Mike

Posted
by mashaper
 

Mashape Online

Our beloved project, mashape.com is online!

What does this mean for us?

Well, it means that we have to go on with the hard work of coding, testing and bug fixing, but also implies to do some system administrator tasks.

At this moment, the platform runs on two Linode virtual machines, with GNU/Linux Debian (64 bit) installed. It started with a simple setup: Apache HTTPD with a connector to 2 different Tomcats (the first for mashape.com, the other runs onair.mashape.com).

This will evolve as soon as possible (before we open to more alpha testers): I'm planning to add two secondary tomcats to do load balance upon these.

Next step in my todo lists is to add two scheduled jobs, one for database backup and the second to check services status.

Are you ready to play? :)  

http://developer.mashape.com

 

Mike

Posted
by mashaper
 

"Hello World"

Posted
by mashaper
Theme by Cory Watilo.
More great Posterous themes at themes.posterous.com.