Showing posts with label Tag. Show all posts
Showing posts with label Tag. Show all posts

Nov 11, 2009

A Lazy Post Count Method

While I really like Matt's blog counting site, I decided it was too tedious to have to jump to an additional page and do all that searching and stuff. I appreciate his hard work and he most certainly displayed his skills learned in the class, but I figured there was an easier way to count your blogs.

All you need to do is put a unique keyword on each of your posts. My unique word is 'Colin'. Now that the keyword is added to the tag cloud, it will automatically count my posts for me.
As you can see in the image, I have posted 10 blogs prior to this post. How simple! Sadly this method will not work for comments, and for that case I will have to resort to Matt's blog and comment counting site.

Note: PLEASE don't add my name to your keywords on your posts. You will ruin my plan and it would be very rude!

Oct 31, 2009

Tag Cloud - How to...

This post will explain how to implement a tag cloud onto your website:
For our group project, we planned to implement a tag cloud on website. We decided for the API of http://www.semager.de/.
At first, we used the proxy to create a request on their server:
$uri = 'www.semager.de/api/tagcloud.php?url=http://people.emich.edu/jabbouda/project/3/index.htm 


The result confused us. The semager-server has not processed the content, displayed on our website. Well, sure. It just processes the information that it founds on the website (without any content which was generated from our scripts).
The problem we had to solve was to save the generated data in a file, but how?
The answer is PHP:
$file=fopen("ebay.xml","w+");
// $file is the file handler. ebay.xml the filename,
// "w+" describes that we want to read and write the
// file, and that it deletes the content of an
// existing file or creates a new file, in the case
// there not such a file

fwrite($file,$xml);
// writes the content fo $xml into the file.
// $xml is the result that we got from the ebay server

fclose($file);
// closes the file after working on that
//

We changed our ebay-proxy file and inserted the lines above. The result is that the xml data that we receive is saved in the file: ebay.xml, on the server.
You have to know that the people.emich.edu does not allow creating / saving by PHP commands. This is the reason why we moved our project to:
http://www.highspeed-karlsruhe.de/cms/tmp/install_4a7adbd79d4d2/is449/

We changed the link in proxy file for the tag cloud and now we receive ready converted html data. This is displayed in the div tag.
Usually you must be able to get this running on your local XAMPP server.

Sep 29, 2009

The Document Object Model

We used PHP to retrieve information from web pages last week. But there are other methods, which appear interesting. One such method is the Document Object Model standard. The DOM provides the information needed for Javascript to communicate with the elements on the web page. The DOM itself isn't Javascript. It's a standard from the World Wide Web Consortium that most browser manufactures have adopted and add to their browsers.

The Document Object Model is the representation of the way the web browser remembers the HTML tags, their attributes and the order in which they appear in the file. There are two methods for selecting nodes. Nodes are the tags, tag attributes, and text of the web page. The two main methods for selecting nodes are:
getElementById() and getElementByTagName()

Getting an element by ID means locating a single node that has a unique ID applied to it. We would use the following Javascript to select the node:

document.getElementById('header')

We can also use a variable instead of a string such as:

var lookfor = 'header';
var foundNode = document.getElementById(lookfor);

When we assign the result of this method to a variable, it allows us to store a reference to a particular tag so that we can later manipulate it in our program. The getElementById() command returns a reference to a single node. The getElementByTagName () command is used to retrieve multiple items.

For example, to retrieve all the links on a page, you could do something like:

var pageLinks = document.getElementByTagName('a');

The varaible “pageLinks “ would store all the links from the selected page in same matter as a array. Therefore pageLinks[0] would be the first link from the selected page.

Beyond the methods I mentioned moving around a page using the DOM method becomes difficult and time consuming. Each browser interprets the DOM differently. Javascript makes using the DOM method almost a waste of time, because of the difficulty of getting the standard to function correctly with all the available browsers.

Sep 23, 2009

Web 2.0 – Tag Clouds

After talking about Web 2.0 technologies I just looked “Web 2.0” up and realized that there is a special form of user interaction that just strikes my eyes: Tag Clouds.

Tag Clouds allows to represent words that users had tagged on posts in a special way:







Often used words will be highlighted by a bigger and brighter color, automatically.

Administrator or publishers can not influence a tag cloud that represents user posts and their tags. The Tag Clouds allows new user to get an idea of the important topics of a website or a blog.

Although this is a very interesting technique of categorizing the content of a website, it is necessary that the used tags are relevant to its specific post. Not tagging or wrong tags would cause a not representative tag cloud. Using some conventions, like the use of only lowercase and only singular, and not that concrete words decreases duplicates and almost similar words in your Tag Cloud. This means that your Tag Cloud will be more meaningful.


Sources:

http://en.wikipedia.org/wiki/Tag_cloud

http://www.smashingmagazine.com/2007/11/07/tag-clouds-gallery-examples-and-good-practices/