Smrf.NodeXL.GraphDataProviders.Twitter.TwitterSearchNetworkAnalyzer.GetNetwork C# (CSharp) Method

GetNetwork() public method

public GetNetwork ( String searchTerm, WhatToInclude whatToInclude, Int32 maximumStatuses ) : XmlDocument
searchTerm String
whatToInclude WhatToInclude
maximumStatuses System.Int32
return System.Xml.XmlDocument
    GetNetwork
    (
        String searchTerm,
        WhatToInclude whatToInclude,
        Int32 maximumStatuses
    )
    {
        Debug.Assert( !String.IsNullOrEmpty(searchTerm) );
        Debug.Assert(maximumStatuses > 0);
        Debug.Assert(maximumStatuses != Int32.MaxValue);
        AssertValid();

        return ( GetNetworkInternal(searchTerm, whatToInclude,
            maximumStatuses) );
    }

Usage Example

示例#1
0
    GetTwitterSearchNetwork
    (
        DateTime oStartTime,
        String sNetworkConfigurationFilePath,
        NetworkConfigurationFileParser oNetworkConfigurationFileParser,
        out XmlDocument oXmlDocument,
        out String sNetworkFileFolderPath,
        out NetworkFileFormats eNetworkFileFormats,
        out String sNodeXLWorkbookSettingsFilePath,
        out Boolean bAutomateNodeXLWorkbook
    )
    {
        Debug.Assert( !String.IsNullOrEmpty(sNetworkConfigurationFilePath) );
        Debug.Assert(oNetworkConfigurationFileParser != null);

        oXmlDocument = null;
        sNetworkFileFolderPath = null;
        eNetworkFileFormats = NetworkFileFormats.None;
        sNodeXLWorkbookSettingsFilePath = null;
        bAutomateNodeXLWorkbook = false;

        String sSearchTerm = null;

        TwitterSearchNetworkAnalyzer.WhatToInclude eWhatToInclude =
            TwitterSearchNetworkAnalyzer.WhatToInclude.None;

        Int32 iMaximumTweets = Int32.MinValue;

        try
        {
            oNetworkConfigurationFileParser.
                GetTwitterSearchNetworkConfiguration(out sSearchTerm,
                out eWhatToInclude, out iMaximumTweets,
                out sNetworkFileFolderPath, out eNetworkFileFormats,
                out sNodeXLWorkbookSettingsFilePath,
                out bAutomateNodeXLWorkbook);
        }
        catch (XmlException oXmlException)
        {
            // (This call exits the program.)

            OnNetworkConfigurationFileException(oXmlException);
        }

        TwitterSearchNetworkAnalyzer oTwitterSearchNetworkAnalyzer =
            new TwitterSearchNetworkAnalyzer();

        oTwitterSearchNetworkAnalyzer.ProgressChanged +=
            new ProgressChangedEventHandler(
                HttpNetworkAnalyzer_ProgressChanged);

        Console.WriteLine(
            "Getting the Twitter Search network specified in \"{0}\".  The"
            + " search term is \"{1}\"."
            ,
            sNetworkConfigurationFilePath,
            sSearchTerm
            );

        try
        {
            oXmlDocument = oTwitterSearchNetworkAnalyzer.GetNetwork(
                sSearchTerm, eWhatToInclude, iMaximumTweets);
        }
        catch (PartialNetworkException oPartialNetworkException)
        {
            oXmlDocument = OnGetNetworkPartialNetworkException(
                oStartTime, oPartialNetworkException,
                sNetworkConfigurationFilePath, sNetworkFileFolderPath,
                oTwitterSearchNetworkAnalyzer);
        }
        catch (Exception oException)
        {
            // (This call exits the program.)

            OnGetNetworkOtherException(oStartTime, oException,
                sNetworkConfigurationFilePath, sNetworkFileFolderPath,
                oTwitterSearchNetworkAnalyzer);
        }
    }