Monthly Archives: December 2012

Channel Your Vision – Call Me Maybe API

Hi! I am starting to dive deeper into the current challenge – Programming Twitter API. Just a quick basic review of the API requirements before we make any calls! Oh wait, why not take a look at what an API call looks like?

twitterapicall

If you type the URL shown in that snapshot into your browser of choice, you will see something like this displayed:

returnedjsonfromtwitter

Ugh! How messy is that? I really hope you will be able to look through that mess and identify some information that could help you build something useful!

Now back to basics: Rate Limiting – Twitter allows up to 150 unauthorized calls per hour (it could be per an application or IP address). Authorized calls have a limit of 350 per hour! You might say, well, 150 is a little smaller if you think of it. How do I get more calls? Whitelisting – This will enable you to get more calls per hour but it is discouraged by Twitter in favor of other techniques like caching, etc.

Take an even closer look at the snapshot below and we will then answer the questions: What are the fields returned and what data types are included?

jsonformatted

What we should agree on is that making an API call does not return such clean and formatted data as shown above! You can use a simple script to achieve the same. Either way, assuming you have turned that mess into the above JSON data, you can see several fields: coordinates, Favorited, truncated, created_at, id_str, entities, and many more. The second question is also easy to answer: data types – string, Boolean, objects, arrays, integers etc. Keep looking, you may find something I didn’t mention.

Let us intentionally make an API call that is broken and then see what happens:

badapicall

There you have it! You get an error message. I didn’t supply the required screen_name or user_id  to the user_timeline method. Try it and see what happens! Be curious.

Third question: Path-style vs. Argument-style API calling. Which one is used by Twitter. Twitter uses both! There is a lot to be said here but I will not start a discussion for it today!

Finally: What is RESTful APII will start by saying this is an advanced concept. In simple terms, it is an API that conforms to the REST constraints and is basically based on a setup where the client sends a request to the server and the server processes the request and returns the result to the client. It uses HTTP protocol. It is also a counterpart to SOAP.

That should do it for today! I hope you found this helpful as you forge a journey through Twitter APIs. If you have any questions, please don’t hesitate to ask. If you have a blog, please leave a link below so I can check it out!

Happy New Year! Peace Be With You!

Advertisements

Programming With Twitter API – P2PU Challenge 2

Hello everyone! I am back again with another challenge from Mozilla P2PU. I just couldn’t wait because completing the first one made me so dang excited! This post is an introductory one, meaning I will not be writing any code today. I will consider this a preparation for the real thing.

While I was getting things ready for the journey ahead, I ran around the web like a bot trying to gather all the necessary documentation and I spent a good amount of time on Twitter’s Developers page scheming through their updated APIs. Below are just a few I had to grab!

twitterapi

One thing you need to do before building any twitter application is to sign up for an account. It is not a strict rule but just common sense especially when you make API calls that require authentication.

I then picked up some snapshots of common API methods that were of interest to me! Take a close look – really!

geoapitwitter

I apologize for the visibility on the above photo but what it should show you is the methods you can use to access Places & Geo from Twitter. Consider an example like you looking for tweets from California or London!

moretwitterapi

The above snapshot shows you two main things: One is the Search API that will enable you to perform searches on Twitter and the second one is Streaming API which has several options for you to exploit!

twitterapiresources

I should have started with this one! It doesn’t hurt really. Often you will hear people say RESTful API and by now you might have noticed something about it: Did I just almost reveal the secret to you? I will let you go figure that out on Google or somewhere! Good luck.

One thing to note here is that understanding the Twitter API will enable you to build applications that you would otherwise just dream of! Sky is the limit, seriously, it is! So, buckle up and let us get started on this adventure together.

Before I end this post, I want to recommend a book I read once when I knew nothing about the Twitter API. One warning though: there have been some slight or maybe major changes to the APIs since the release of the book but those changes are easy to adapt to. Below is the cover of the book:

twitterapiupandrunning

The author of that book is Kevin Makice and the last time I talked to him, he said a second edition is in the works. It should be out sooner or later – but you don’t have to wait on it. There are a lot of resources out there for you to be up and running with Twitter API.

Thank you for visiting once again and I hope to see you around as I dig deeper into this challenge and uncover the power of Twitter. Moving from just a regular user to a developer is very exciting! Let us do this, shall we?

Note: You will find more information on this subject by visiting, you guessed it, Twitter Developers Page

If you have any questions, please ask them any time through the comments section! See you!

Final Blast Off – Houston All Clear: level #6

I am finally at the end of this wonderful challenge! There is a lot I could say about it as far as experience is concerned but instead, I will show you in images – after all, they speak louder than words, right? Let us first say I had a blast(no pun intended) doing this!

In the beginning was a challenge and that challenge reminded me to use my own hands hence ending up with this:

dayonehtml

After that pen and paper adventure, I realized that I had to go further! So I said, let there be a text editor(save some trees) and browser. A baby was born – in a form of a simple web page!

dayonelevel2

You know what happens to kids when they start running? You let them do it because that is how they learn to grow! This happened when I brought in the browser! [How do you really look like to the world?]browserview

Once more, kids grow up and you end up kicking them out of the house because they have to face life on their own. But to be a good parent, you help them find a place they can call home! So, I went on a mission, cosigned for my young son a rental property and now am free from all the chaos that kids come with when they are born. Finally, this is what he is doing – showing off!

p2puchallengefinal

Wow! What an amazing adventure! After several hours of dedicated work, I finally completed this journey – but this obviously is just the beginning!

Roger: I just received an update – my new website/young boy just informed me that he has upgraded from just a plain text page to an interactive website. He said you can actually use Google Maps API to locate your current position relative to his headquarters! I knew it, kids grow up so fast!

Final Note: While completing my challenge, I ended up using Cyberduck File Transfer Protocol(FTP) client and I found it to be so much fun. I have enjoyed this learning experience so much that I wouldn’t mind doing it again next time. I am not sure where the next challenge will lead me but am sure it will be even more exciting!

If you have any questions(like how to include a map on your pages), please drop them in the comment section so we can connect. Also, remember to leave a link to your blog so I can check it out! This is definitely not the end of the road, there is more and more to come! So, stay tuned.

You can take a brief tour of “his” new home by following this URL:

Simple Developer New Town House

Watch out, you might actually love it!

Web Hosting & Going Live – Level #5

This challenge requires whoever is taking it to get a website up and running. So, what is better than testing the waters with free web hosting and even a domain before choosing to spend some cold hard cash on a service? Sounds good to me especially since I am not expecting killer traffic any time soon! I am going to head over to 000 Webhost Inc, create an account and pick up a free domain! Excited!
freewebhostingsnap

After logging in, I just go ahead and start the next step as shown and described below:

webhostingacc

Now that I have setup my brand new account, I am ready to start rolling with my new domain name! Note: If I had registered my domain somewhere else, I would have to edit my DNS settings to point to http://www.000webhost.com but since I didn’t do that, I am all set. Now, let us move to the next step already! My free domain is http://www.simpledeveloper.net78.net and I know it is not the best. Locate the File Manager in your account and click it!

filemanager

Clicking that folder might require you to log back in due to session expiration. After getting back in, you will see something similar to the one below:

ftpfilemanger

While uploading your files to their servers, you are required to put them in the above directory [public_html] to be exact! So, how do you upload your files? There are several ways to do this: 1) Try several tools available for free for different platforms and 2) look at the photo below to see another option available to you inside your account!

fileuploading

Please make sure that you are in the right directory as shown by the two arrows above or you will run into problems. You can then click the upload button to upload new files into your server. There is one thing I didn’t mention: remember to delete the default.php file that is already in your server!

You are probably asking: what if I have hundreds of files, will I have to do that hundreds of times? The answer is, thank goodness, NO. There are free FTP clients all over the web and one of them is FileZilla and some web development tools like WebMatrix come with that capability built-in so you just need to click a button and get your website published! Awesome right?

So what do you need to use such clients? Simple, you need your username and password. But where are they located? I am going to complete this post with just that last image showing where you will find them:

ftpinformation

Phew! Just keep the information shown by those arrows close to you because one way or another, you will need them to upload your files to the server! I hope this tutorial was helpful and if you have any questions, please let me know. I will be working on my cool new website at Simple Developer even though the most important thing I was trying to do here was to help those who needed to do this for their first time!

Please leave me some comments and let us talk! Good luck and go take over the world!

Domain Names & DNS Hacking – Level #4

In this challenge, we are supposed to browse around the web for a trusted registrar, then decide what we want our domain name to be and then register it! I am going to talk briefly about what factors to consider while choosing a registrar.

First of all, you should realize that you are going to spend money getting your domain registered and anything that involves money needs some serious decision making. After you have made a sound decision on how much you want to spend, head on to the registrar’s site of choice and peruse around for packages that fit your needs. You simply enter your preferred name and they will notify you if it is available or already taken.

The other factor to consider before making any domain purchase is customer service. How do you find out about it? Simple, visit any business ratings company, like yelp, BBB or just use Google! You will save yourself a lot of stress by reading through them before spending your money.

Sometimes, it is a good idea to know how long the company has been in business because you don’t want to be shocked when your domain goes down all over a sudden because the company went down. Your customers or business are on the line here!

Personal suggestions: I found 1and1 Web Services pretty cool. Their customer service is good too. Another option is Godaddy . The fact is that I cannot list all of them here because there are thousands out there hunting for your money! The best thing to do is use Google Search and find what will be the best choice for your needs.

1&1capture

One other thing to remember is that you can register your domain with one company and host it with a different company. Here is how: If the registrar does not offer free hosting and you don’t want to spend money every month hosting your small website, you can simply host it somewhere like my favorite 000 Webhost Inc and you will not spend anything until you hit the limit – which is going to take you a while. You will need to edit your DNS settings to point to your current hosting company. I am going to talk briefly about DNS in the next section, so don’t worry for now!

If you are good with images, then good for you! Here is an image describing how a DNS server works! Enjoy.

DNS-Server

So, how does a Domain Name Server works? I will try to make it as simple as possible but also as informative as I can. Obviously there is more to learn about DNS and you can follow a link at the bottom of this post that will lead you to more information.

One thing that is true is that if you have used the internet, you have used the Domain Name System without knowing or realizing it. DNS therefore is a protocol within the set of standards for how computers exchange data on the internet and many private networks available today. The protocol itself is known as TCP/IP.

Its main job is to translate or turn a user-friendly domain like “google.com” to an Internet Protocol(IP) address like 70.42.251.42 that computers use to identify each other on the network (This process is also known as Domain Name Resolution). You could say DNS is a phone book for the internet. Without DNS, it would be extremely hard to connect computers on the internet!

Now that we both somehow understand how this works, I am going to stop here because this post is getting too long. I am going to leave you with links to other great resources and I hope you will be better-equipped and you will share your brand new domain name with me in the comments section after you register one and publish your website. I couldn’t exhaust the details and in fact, I just touched the tip of the iceberg here. Ask any questions you may have!

For more information on Domains, DNS, and TCP/IP, please check out the links below.

DNS On Wikipedia

Windows Server

DNS TechRepublic

Thanks again for visiting and hope to see you again!

HTML Tags Hunting Around Me – P2PU Level #3

This is my level 3 challenge! The requirement of the challenge was to put together descriptive images representing several html tags and then create a post on my blog. I will be honest, it was really cold outside today and I had to be creative enough with what I had around me. The falling snow is my witness!

So, I took an extra step and created what I think should be a good representation of html tag information – using stickies. I really liked the original idea because it helped me remember the concepts behind the tags very well. Too much talk? Me too, let us just see the photos already!

htmltags

That was the first batch of stickies that I used while putting the project together! Now below is the second and last image showing the remaining tags required by the challenge! Enjoy

htmltags2

Obviously, there are more tags in the html universe! For more information on where to find them, please visit World Wide Web Consortium and you can also visit Mozilla Developer Network . You can also get a real learning experience by trying out W3Schools and Codecademy . The list goes on and on! So, the best thing to do is pick one and see if you like it!

Good luck and I hope you enjoyed this post!

NOTE: If you are wondering how I created those stickies, I used HTML5! You can always drop me a line in the comment section so we can talk more about it!

Text Editors – P2PU Challenge Level #2

There are several choices available to you when it comes to choosing an editor for your daily web development works. At first the task of searching and settling on one option can be daunting but you can always ask friends for ideas.

For me, I have chosen to go with Aptana Studio 3 for some obvious reasons.

aptanastudiosnap

First of all, this is the point where you leave your “There is no free lunch” mentality and be thankful for this great software provided to you for FREE by those who have chosen to do so. You can still choose to support the product in one way or another but you do not need to pay a dime to start rolling out great web applications.

The second reason I chose Aptana Studio 3 was how integrated it is. You can do pretty much everything with it. You can write python code, html. css, javascript just to name a few of them. Just try it and you will love it – at least I did.

The third reason for loving this editor is the dark background color! I mean, who doesn’t love that? It makes me feel like a pro – although that might come out a little vain especially if you are not one! Either way, this is my IDE of choice and I will keep utilizing it for my projects. Highly recommended

Below is a small snapshot of the same in action:

IMAG0019

I will not dictate the kind of editor you should use. So, to be fair, I will list a few other editors that I can remember and that might help you decide on what you want to use.

  • Notepad++
  • WebMatrix
  • VIM
  • Visual Studio
  • Others

Thank you for visiting and I hope this post either helped you decide on which editor you want or gave you the necessary information that will guide you as you look for one!

You can download Aptana Studio 3 by visiting Aptana Studio

Good luck and remember to subscribe!

HTML 101 – Hello World Level #1

This is my first leg at learning html as I undertake the Mozilla p2p challenge:


<!DOCTYPE html>
<html>
     <head>
          <title>Hello World Mozilla!</title>
     </head>
     <body>
          <h1>Welcome to Simple Developer Blog!</h1>
          <p>Thank you for visiting my blog! I created this blog
          so I could follow along with my P2P programming challenge
          over at Mozilla Developer network. Remember you can easily
          join the community as well and start coding with us!</p>

          <p>Thanks again and hope to see you again! Remember this is
          the first html markup that I have written on this blog - I
          have used html before, including the advanced html5 itself.

          Let us get moving, shall we?</p>
     </body>
</html>

The outcome of viewing the above markup on a browser is shown below:

vieweed on browserThat should do it for now and next time I will be doing something bigger and better!

The photo below this line shows a handwritten html code as required by the challenge!

blogosphere

It is as simple as that!

Simple Developer – Mozilla Developer Network P2P

Hello there! Thank you for visiting my blog. This is my first blog post and I have a few things I want to talk about before I embark on the exciting web development journey.

First of all, I will say I am not an expert and saying that creates room for further learning. I like learning new things, and I hope you do too because if that was not the case, life would be really boring!

I am starting a new journey over at Mozilla Developer Network through the Peer-to-Peer program and I will be updating this blog as I go. I really hope you will join me in this adventure so that we can explore the vast resources the internet offers for free.

If you have any questions, please do not hesitate to ask me through the comments section. I will be more than happy to jump in and answer them as soon as I can!

Thank you again and as I said, this is just the beginning. There will be more to come and I really encourage you to subscribe and let me know what you think about web development in general.

________________Eenvincible