Showing posts with label iteration 2. Show all posts
Showing posts with label iteration 2. Show all posts

Mar 17, 2010

Indivudual Iteration 2

For iteration 2 I changed my plans for the API's I was planning to use. Originally, I wanted to create a site using the Blogger API in combination with the Google Talk API to allow users to have live chat with others that were in the blog site. However, this seems to be more complicated than I expected. Google Talk API uses XMPP or Extensible Messaging and Presence Protocol. In order to connect to Google Talk or any other service that supports the Jabber/XMPP protocol, you'll need to purchase Trillian Pro. So I decided to go a different direction with my project.

The new plans for my site is to use the Chronicling America API along with the Google Maps API. The Chronicling America API gives information about historic American newspapers. So far I have completed the iteration 2 requirements and have set up the Google Map API and am able to return the XML for the Chronicling America API using an onClick button.



The next step is to complete iteration 3. I plan to take the XML that is returned and parse the information to display the newspapers by location on the Google Map for Michigan. This iteration seems like it will be more difficult than the others, and I hope that I will be able to complete this task.

Mar 11, 2010

Individual Iteration 2

Since Iteration 2 was due yesterday, I figured I'd write about my own frustrations and a few things that are going on with our group project. I am very sad that I could not get my program to work. Usually I try and try and try and then something happens but this time I had no luck. I attempted to display my blogs from my IS279 class in which we have to write at least 5 blogs a week. I thought it would be cool to show my blogs that I have written for that class. It seemed like a piece of cake when I was thinking about it but it turned out to be more complicated than expected.



I did all the usual stuff look over John's code and then turn it into my own but that did not work. Here is what it looks like:



I went to see John Wednesday morning and he helped me out a lot but then I kept getting the "Document" is null or not an object error for this part if my code:

function formatFeed(xml){

var html = "";

var thisEntry = xml.documentElement.getElementsByTagName("entry");

At this point, I changed a few things and the error messages stopped but nothing happened. I was hoping that the server just wasn't updating in a timely manner but that's not the case because I tried to run my program today and no luck. So I didn't get it to work.

As for the group project goes, my group had to change which sites we wanted to use because two of the sites didn't have APIs. So we made a quick decision and we're planning on using two different sites now.


Mar 8, 2010

Work on iteration 2

Iteration 2 has been more of a challenge for me then iteration 1. The reason it is more challenging is because I am making it more challenging. The only problem is now I am the frustrating period and not getting past it.

The first thing I attacked was including the api fanfeedr to my iteration 1. I started coding and then decided to learn more about css and format instead of staying on topic with the project. After getting back to fanfeedr, I registered for my api key. The good news was the key was free and didn’t take very long for the key to be sent to my e-mail. After looking at more code and trying to incorporate fanfeedr, I have realized that fanfeedr code is in the form of JSON and not XML.

So, this marks my first problem. I looked around and could not find how to parse the format JSON. I am going to try and do a search on the blog and maybe someone from last semester had a similar situation. I then ran into the problem that my original iteration decided not to work. So, I then proceeded to create a test folder for the fanfeedr. So, I just about started over but was not too hard with copying most of my code. I then didn’t have to worry about ruining something that already works. Once I get it to work then I can just slide it into my working original iteration.


For Wednesday, I am going to just try and use an easier API that I will hopefully be able to produce. I am going to keep holding onto the fanfeedr information and try and incorporate it into my project for possibly iteration 3.

Does anyone have any experience with Google Maps and getting it to work? My question is how do you the maps that you have in your my maps folder?

Mar 5, 2010

Div tag scroll bars

I'm not sure if any of you have run into this problem but when I was outputting my XML to my web site I was constantly overflowing the div window with results. At first I was trying to minimize the results by creating for loops that only printed a certain number of results. While this was effective it didn't allow me to have as much content as I wanted to display. However, there was a solution.

I did a search in Google for "Scroll bar DIV tag" I was surprised by the amount of results but I was more surprised at how simple it was. You can check out the results of the search here. Anyway the only thing I had to do was to put this simple bit of code into my style sheet.

overflow: auto;

That's it, not too complicated but oh so effective for presenting tons of results in a small window in order to fit into web site. This little gem allowed me to stuff 25 news stories into a small widow within the page. Here is the results.


Multiple API requests

So one of the problems that I ran into when working on my iteration 2 was that when I was creating multiple proxy requests, I could only get one of the API to return data. After some research and talking with professor Drake, he was able to point out that it was possibly because I was using the same createRequest() function to make the calls. After thinking about it for a bit, it became perfectly clear. The createRequest() function uses global variable and what was happening was that I was overwriting the globals with the second results when calling the function twice. So what I had to do was this. Create a function for the weather request.

function weatherRequest() {
try {
weatRequest = new XMLHttpRequest();
} catch (tryMS) {
try {
weatRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (otherMS) {
try {
weatRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
weatRequest = null;
}
}
}
return weatRequest;
}

I then had to create another function with different global variables.

function descriptionRequest() {
try {
descRequest = new XMLHttpRequest();
} catch (tryMS) {
try {
descRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (otherMS) {
try {
descRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
descRequest = null;
}
}
}
return descRequest;
}

Once this was accomplished I also had to create a different proxy script for each API that I wanted to call. This is because of the fact that each proxy is returning data and if you try to use the same proxy you either need to create all new variable and requests within the proxy script or you just need to have separate proxy files for each request. I chose the latter for simplicity and separation fo the code for troubleshooting purposes.

//*********************************************************************************

function getDesc(itemName) {
descRequest = descriptionRequest();
if (descRequest == null) {
return;
}
//alert("getDesc()");
url= "scripts/description.php?ImageID=" + escape(itemName);
descRequest.open("GET", url, true);
descRequest.onreadystatechange = displayDetails;
descRequest.send(null);

}

//*********************************************************************************

function getWeather(zip) {
weatRequest = weatherRequest();
if (weatRequest == null) {
return;
}

url= "scripts/weather.php?zipID=" + escape(zip);
weatRequest.open("GET", url, true);
weatRequest.onreadystatechange = displayWeather;
weatRequest.send(null);

}

Then it was just a matter of displaying the results to each of the div tags assigned. This was also accomplished using separate functions.

//*********************************************************************************

function displayDetails() {
if (descRequest.readyState == 4) {
if (descRequest.status == 200) {

document.getElementById("description").innerHTML = descRequest.responseText;
}
}
}

//*********************************************************************************

function displayWeather() {
if (weatRequest.readyState == 4) {
if (weatRequest.status == 200) {
//alert(request.responseText);

document.getElementById("weather").innerHTML = weatRequest.responseText;
}
}
}

That's it. So essentially for each API that you use you will need to have a set of separate functions to handle the requests and the displaying of the data all with different global variable. You can check out the results of this HERE.

Dec 16, 2009

Group Iteration 3


Well, I can say that we are almost there. We have the major APIs working, but still run in some bugs. Overall our group came from a long way, since we had limited knowledge in programming. The biggest issues we had was with the pointers on the google mapls, we could get only one. Hopefully by the iteration tonight we will be fine.

I found out while I was working on the ebay API that after you create an account they offer you a full set of develping tools. That is how I learned how to set up the API. It was really nice because I learned some really usefull tips.

Overall we understand the underlying idea of the progect and the techonology behind it. It is that we do not have the final touches. On the other side I do think that we had a really nice idea about the project, just could not fully implement it. Hopefully what we have is enoegh to get us a good grade.

Dec 2, 2009

Final Individual Iteration

Well, I see some poeple have really fancy things for their iterations. Unfortunatelly, I am not one of them. I went with the minimum requirements. Actually I did not have much time to work on the bugs I was getting, so I decided to go with just plain xml RSS feed.

As you will see I kept what I had from the last iteration which was pulling name and time from a blog. the only thing I changed on is that I segmented it better where I put some spacing and also included more information. It is nothing fancy, but I hope this part would be safficient to get me through this iteration.

Another, item that I added was a RSS feed from the website called indeed.com. I mentioned in my last blog that this is a tool searching for jobs, that incorporates all job sites, meaning that throught indeed.com you can actually search simultaniusly in sits like monster, and dice, cereerbuilder. What I did is that I preset the search requirements for an IT job with yearly salary over a $100 000 in michigan. You would be surprised but there were quite a few. So I did try to pull just listing and the description for the particular RSS, but I kept having different error. So i have decided to have something working rather than something does not display anything with errors. So this is what I have.

Nov 18, 2009

Iteration 3

Some of you probably already know, but the professor have decided to go easy on us, by changing the requirements for Iteration 3. In his last email he has sent the new agenda what we need to do. The two main items were to clean up the RSS feed so it has a clean and meaningful output or pull another web service. It seems that most of the class is already done for Iteration 3 since they have completed those requirements in Iteration 2.

Actually these new requirement will definitely help me since I am not so sure what I was going to do for my Iteration 3. I was worried about it, because I got lots of help from the professors examples in class. So here is what I have so far...







So for iteration 3 I might pull different information from the RSS feed, or maybe incorporate another feed from another blog service, by pulling only the time when the blog was created or maybe pulling the author's profiles. I really want to do something more useful so if any of you have any tips, please let me know.

Nov 11, 2009

Iteration 2 - It's over!


I just wanted to congradulate everyone for making it through iteration two with their projects. Their were alot of good looking mashup's, definately things in all of them i wish i had thought to ultize in either my personal project or the group project. So give yourself a pat on the back and relax a little, as i know for me that was quite stressful at times.

And if you need something to help take the edge off you can use this site to help you relax. :-)



GROUP ITERATION 2

Well, up to this point I think we are on the right track. I am sure we could do better but this is what we came up with so far. We have incorporated Google maps, and also two other proxy servers. One of them gives us an RSS feed with concerts all around the country called 5gig and the other gives us the rating of a particular band or song called billboard. I think our idea is pretty cool, but it seems very hard to implement due to limited knowledge in Java.

The best part about our project is that 5gig gives us already the latitude and altitude of the particular concert locations. The problem is that we do not know how to tide them together. The problem we are facing is that we are pulling the full RSS feed from both proxy servers. I did try to follow the book and the professors notes, but still could not figure out how to pull only particular information of the xml file. To be honest the book confuses me more.

So for Iteration 2 it would be nice to have the feeds segmented and have them talk to each other. Hopefully we can have more progress by tonight's presentation. By the way if someone could help us, it would be greatly appreciated. All i can say is that I am trying to follow the book but it definitely slows me down since it confuses me more. I might be the only one who feels that way though.

So here is what we have so far .....



Nov 4, 2009

Iteration 2

Well i had a horrible time but i finally got my Xml pass through to work. It looks horrible but i can spend time later to gussy it up. I had great difficulty trying to follow the example the professor had set before us. It took several hours but i realized i was looking at the wrong example first. I had started with the finished model. Several pieces of code threw me in several directions.

function formatFeed(xml){
var html = "";
var thisEntry = xml.documentElement.getElementsByTagName("entry");

for (i=0; i
" + unescape(tagval(thisEntry.item(i), "content")) + "

";
}
}
return html;
}

The previous piece of code took me forever to decipher and i still have questions. From what i can tell its a loop that looks at the author you have chosen, selects them from the blog list and then displays their name and latest post.

This was throwing off any time of output i wanted on my screen and instead had to change the display function to the follwing:

function displayDetails() {
if (request.readyState == 4) {
if (request.status == 200) {
document.getElementById("content").innerHTML = request.responseXML;
}
}
}

This finally got the XML information to display unformatted on my page.

Nov 3, 2009

Individual Iteration 2

Iteration 2 for our individual project required that I fetch a file from a web service using the php pass through and incorporate it into my web page without using a an alert box and demonstrate actions tied to event handlers.

In my webpage I have chosen to create two buttons which use the onclick event handler that get services from the sponge cell calender API and the yahoo weather API using the php pass through for each.

I am continuing to work on my individual project and make this information useful. There is still a lot of things I don't quite understand when it comes to manipulating the data. I am looking forward to finding new ways to retrieve and display specific information.

Here is an image of how my web page has turned out so far: