Build Your Own *form Task, part 2

Posted on September 2, 2011
Filed Under Splatforms | 31 Comments | Share this post via splatforms.com

Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to alter an existing Task is to modify the source, or *form Type. Those of you who have been playing along at home will remember that there are five (5) basic Types of *forms: Text, Link, Article, Event, and Contact. Although each unique Type shares a limited set of common data elements with all or most of its cousins, the complete collection of data available for each Type is specific to the Type. Two types that are similar in nature are the Link and the Article; both have tags and titles, only the Link has the URL property, but a Link has comments and an Article has a body, both of which are roughly equivalent. So, it wouldn’t take that much to copy something that was built to post a Link and convert the copy to something built to post an Article.

It wasn’t all that long ago that we were playing around with HubPages, so let’s just grab that Task that we build to post a Link to a HubPage. This link only works if you are logged in to your Splatforms.com account, but if you are, you can see the entire Task here:

http://splatforms.com/data/task2.php/520

Just FYI for those that have a little bit of hacker in them: you can actually use that link above to look at any *form Task — just change the number 520 there on the end to the Task number of the one that you want to look at. Again, you have to be logged on, but once you are, you can look up the full details on any Task in this way, or just put in a random number and see what you get back. But we digress …

Here’s a screen shot of the link above for those of you who have not yet set up your account:

Task Detail

Task Detail

If you look closely at the Task, you find that it has five (5) steps:

  1. Fetch the Logon page,
  2. Complete and submit the Logon page,
  3. Follow the post-login redirect back to the Logon page,
  4. Fetch the Hub edit page, and finally
  5. Post data to the edit tool.

If you look even closer, you can see that the *form data only comes into play in that very last step. Every other step in the Task is just preparation for that final step, which is the money shot in this entire orchestration. From that you can see that, as long as we know that the rest of the thing already works, there is no real pressing need to know or understand how any of that works. We have no interest in changing it in any way, so all we really have to do is to focus on the part that is going to be different in our version, and all of that happens in Step #5.

In fact, the only thing about Step #5 that has to change is a single property of the step: the parameters to be posted. Everything else can stay exactly as it is. Not only that, every single one of those parameters on the list can stay exactly as they are except for one: content. Let’s take a look at what we are posting to the “content” parameters right now:

<p><em>Posted:</em> $rightNow.toString(“EEEE, MMMM d, yyyy ‘at’ hh:mm aaa”)<br/>
<em>From:</em> <a href=”$url” target=”_blank”>$url</a></p>
<p>$comments.replace(“\n”,”</p><p>”)</p>
<p><em>Tags:</em> $tags</p>

Now, a lot of that is HTML, and for those of you who do not know HTML, don’t worry — the HTML in this example is pretty simple, and we’re not going to mess with it all that much. And for those of you who haven’t even a clue what the hell it is that we are taking about, the HTML is all of those little “tags” enclosed in less than (“<“) and greater than (“>”) symbols. Web browsers and other rendering agents use those to determine how to display the text that is not a tag. To see how that works, compare the snippet below, with the actual rendered version below:

Posted: $rightNow.toString(“EEEE, MMMM d, yyyy ‘at’ hh:mm aaa”)

From: $url

$comments.replace(“\n”,”

“)

Tags: $tags

This time, instead of escaping the tags so that they would be displayed instead of interpreted, we just fed your browser the raw HTML, and the browser did what browsers do with HTML: it let the HTML control how the rest of the text was displayed.

But, enough of that little side trip — back to the task at hand. Now that we see what this Task does to format the “content” parameter to display the data from a Link *form, let’s see what we have to do to modify it to display the data from an Article *form instead. For starters, an Article has no “URL”, so we can strip that part out right off the bat, leaving this:

<p><em>Posted:</em> $rightNow.toString(“EEEE, MMMM d, yyyy ‘at’ hh:mm aaa”)</p>
<p>$comments.replace(“\n”,”</p><p>”)</p>
<p><em>Tags:</em> $tags</p>

An Article does have a posting date, and it also has tags, so those two lines can stay, but it doesn’t have comments, it has a body instead. One quick fix could be to simply replace the word comments with the word body and leave everything else well enough alone:

<p><em>Posted:</em> $rightNow.toString(“EEEE, MMMM d, yyyy ‘at’ hh:mm aaa”)</p>
<p>$body.replace(“\n”,”</p><p>”)</p>
<p><em>Tags:</em> $tags</p>

Although that would work, in actual use it might not end up looking so well. The Link task was surrounding the comments with paragraph tags, and was also replacing all of the line feeds within the comments with endind and beginning paragraph tags. This was done because comments are not usually marked up with HTML tags, so this adds the tags to make things display a little nicer. Articles, however, usually are marked up with HTML, so this step will add extra tags in addition to the ones that are already present in the article. A more appropriate approach for an Article *form would be to simply drop in the article body and assume that it is already marked up with the appropriate HTML:

<p><em>Posted:</em> $rightNow.toString(“EEEE, MMMM d, yyyy ‘at’ hh:mm aaa”)</p>
$body
<p><em>Tags:</em> $tags</p>

And that’s it. We have copied Task #520, changed the Type from Link to Article, changed one value of one parameter of one step from the original Task and left everything else as it was. We should also rename it and change the description, but that’s all there is to it. Without knowing a whole lot about how all the rest of it worked, we just focused in on the part that we wanted to behave differently and stayed away from the rest. Now all we have to do is add this Task to our own preferences, post an Article *form and see how it works.

This one was a pretty simple example, but it was enough to demonstrate some general principals. Next time we’ll see if we can stretch a little bit and do something a little more challenging.

Comments

31 Responses to “Build Your Own *form Task, part 2”

  1. pligg.com on September 2nd, 2011 8:54 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something…

  2. pligg.com on September 2nd, 2011 8:57 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  3. pligg.com on September 2nd, 2011 9:13 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks…

  4. marketguild.com on September 2nd, 2011 9:15 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and th…

  5. newsmarking.com on September 2nd, 2011 9:22 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  6. foxbizz.com on September 2nd, 2011 9:22 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  7. addsharer.com on September 2nd, 2011 9:24 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  8. tomoroku.com on September 2nd, 2011 9:27 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  9. telesmatic.com on September 2nd, 2011 9:29 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks…

  10. pligg.com on September 2nd, 2011 9:35 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways t…

  11. moomdigg.com on September 2nd, 2011 9:39 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  12. ithemes.org on September 2nd, 2011 9:43 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  13. indiasurfer.com on September 2nd, 2011 9:58 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  14. bookmox.com on September 2nd, 2011 10:09 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  15. chuv.com.ua on September 2nd, 2011 10:15 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  16. yebooo.com on September 2nd, 2011 10:26 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks…

  17. orthodoxstuff.com on September 2nd, 2011 10:36 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  18. SERPD on September 2nd, 2011 10:50 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something……

  19. merolinks.com on September 2nd, 2011 11:14 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  20. socn.spx.at on September 2nd, 2011 11:24 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks…

  21. madstyles.com on September 2nd, 2011 11:32 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  22. pligg.com on September 2nd, 2011 11:39 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let…

  23. Yemle.com on September 2nd, 2011 11:42 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something…

  24. Dekut.com on September 2nd, 2011 11:51 pm

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  25. Build Your Own *form Task, part 2 : Splatforms | Do It Yourself on September 3rd, 2011 1:41 am

    […] the original post: Build Your Own *form Task, part 2 : Splatforms This entry was posted in Uncategorized and tagged leave, posted-on-september, stuff-out by admin. […]

  26. Build Your Own *form Task, part 2 | Top SEO News on September 3rd, 2011 4:53 am

    […] From: $url […]

  27. socialbookmarking.co.in on September 3rd, 2011 5:26 am

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  28. v12.me on September 3rd, 2011 5:30 am

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something out of something else. One of the simplest ways to …

  29. cvul.com on September 3rd, 2011 6:42 am

    Build Your Own *form Task, part 2…

    Now that we’ve gotten all of that background, conceptual, and theoretical prerequisite stuff out of the way, let’s look at some real Tasks and see if we can’t actually make something…

  30. Build Your Own *form Task, part 3 : Splatforms on September 9th, 2011 7:03 pm

    […] the last installment of this series we took an existing *form Task that posted a Link *form to HubPages and converted it to post an […]

  31. Build Your Own *form Task, part 3 | Top SEO News on September 10th, 2011 2:50 am

    […] the last installment of this series we took an existing *form Task that posted a Link *form to HubPages and converted it to post an […]