What does everyone think?

Topics: Developer Forum
Coordinator
Dec 8, 2006 at 9:27 PM
Please post comments about what you think about this project!
Feb 4, 2007 at 1:49 PM
Downloaded the help file. Index etc. is there on the left. There are no details pages on the right.
Coordinator
Feb 4, 2007 at 7:17 PM
Edited Feb 4, 2007 at 7:17 PM

kingsmead wrote:
Downloaded the help file. Index etc. is there on the left. There are no details pages on the right.


Hi, do you mean you don't see anything on the right even if you click on an index item? The documentation is auto-generated from the code, so there won't be any high level help on how to use the package. For that, unfortunately, you'll have to just look through the various namespaces and classes and read about them individually. You're welcome to write more general documentation about the whole package if you'd like :-) Any help is appreciated.

Thanks,
Kevin
Feb 7, 2007 at 12:14 PM
If you don't see anything on the right, it's probably because your help file is blocked. It's a security patch on XP and 2003, you can't view .chm when you download it from internet.

To view it use this method:

1. Right-click the CHM file, and then click Properties.
2. Click Unblock.
3. Double-click the .chm file to open the file.
Coordinator
Feb 7, 2007 at 5:50 PM
Thanks adeschenes, I misread kingsmead's question.
Mar 2, 2007 at 1:46 AM

adeschenes wrote:
If you don't see anything on the right, it's probably because your help file is blocked. It's a security patch on XP and 2003, you can't view .chm when you download it from internet.

To view it use this method:

1. Right-click the CHM file, and then click Properties.
2. Click Unblock.
3. Double-click the .chm file to open the file.



Just to expand on adeschenes reply, this is the side effect of the Alternate Data Stream.Zone.Identifier that is applied on NTFS files when downloaded from the internet, I had prepared a quick article on this at http://www.outbackdotnet.org/Articles/tabid/356/Default.aspx which may assist in understanding why the .chm is having problems...
May 18, 2007 at 8:44 PM
I dig the idea (having one large file with all the features but that you can easily trim to just the features you need) and the feature-set.

Is there somewhere we can get/see example usage of the screenscraper functionality?
May 19, 2007 at 9:15 PM

sirshannon wrote:
I dig the idea (having one large file with all the features but that you can easily trim to just the features you need) and the feature-set.

Is there somewhere we can get/see example usage of the screenscraper functionality?


Thanks sirshannon. Unfortunately there isn't much documentation on the screenscraper stuff. It's also not designed terribly well. The novel pieces to it are that it automatically handles cookies, and browser redirection (including the META refresh tag), but the "not well designed" part is that you still have to manually build the form to submit, and look for the content that you want.

Here is an example command line program which gets my current credit card balance for my primary CitiCard credit card. I made this in about 10 minutes, which shows the potential for the ScreenScraper package; however, I haven't developed it for some time. If you're interested in contributing, I would be very happy :-)

using System;
using System.Collections.Generic;
using System.Text;
using PublicDomain.ScreenScraper;
using PublicDomain;
 
namespace playscraper
{
    public class Program
    {
        /// <summary>
        /// Command line program to get the current outstanding
        /// balance for a user on CitiCard.com
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            // args[0] is the user name
            // args[1] is the password
            if (args.Length < 2)
            {
                Console.WriteLine("usage: citicard.exe username password");
                return;
            }
 
            // We provide the domain in the constructor for request referers
            Scraper scraper = new Scraper("www.citicards.com");
 
            // First, we grab the main page for CitiCards. We
            // expect that this will do the necessary forwarding to the https://
            // main site. This main navigation will create any necessary
            // cookies.
            ScrapedPage mainPage = scraper.Scrape(ScrapeType.GET, "http://www.citicard.com");
 
            // Now, populate the login form and submit it. There is no
            // automatic way to do this, unfortunately. If the form changes
            // then this will break. CitiCard has a lot of hidden fields which
            // we also pass along
            ScrapedPage accountSummary = scraper.Scrape(ScrapeType.POST, "https://www.accountonline.com/Login",
                "USERNAME", args[0],
                "PASSWORD", args[1],
                "NEXT_SCREEN", "/AccountSummary",
                "siteId", "CB",
                "fp_browser", "",
                "fp_display", "",
                "fp_software", "",
                "fp_timezone", "",
                "fp_lang", "",
                "fp_syslang", "",
                "fp_userlang", ""
            );
 
            string balanceString = accountSummary.FindSubstring(
                "<td nowrap colspan=\"2\">Current Balance",
                "<td nowrap colspan=\"2\"><b>Current Minimum Payment Due</b>",
                true
            );
 
            double balance = 0;
 
            if (!string.IsNullOrEmpty(balanceString))
            {
                balanceString = RegexUtilities.Extract(balanceString, @"<td align=""RIGHT"" ?>\$(\d+\.\d+)</td>", 1);
 
                if (balanceString != null)
                {
                    balance = double.Parse(balanceString);
                }
            }
 
            Console.WriteLine("Current Balance: {0:c}", balance);
            Console.Write("Press any key: ");
            Console.ReadKey(true);
        }
    }
}
 
May 21, 2007 at 2:42 PM
thanks!

I will check this out as soon as I can and if there are any places I see that I can help with, I will try.
Jun 20, 2007 at 6:54 PM
First, thanks a million. It took me forever to find a .NET implementation of the Olson tz database.

My suggestion: Could you change the namespace for this project to CodePlex.PublicDomain, or some such. PublicDomain is too generic.
Coordinator
Jul 28, 2007 at 4:30 PM

naturalethic wrote:
First, thanks a million. It took me forever to find a .NET implementation of the Olson tz database.

My suggestion: Could you change the namespace for this project to CodePlex.PublicDomain, or some such. PublicDomain is too generic.


Hi naturalethic,

Is there a particular problem with just PublicDomain? I don't really want to tie this to any particular context such as CodePlex. It's really just "public domain" code, and it's also shorter :-). I'm open to persuasion...