Exemplo n.º 1
0
        private void Invoke_Archived()
        {
            string apicall = @"http://api.geonames.org/wikipediaSearchJSON?q=Tampa&maxRows=50&username=devfish";

            System.Diagnostics.Debug.WriteLine("OMG!  GET RID OF THIS HARD CODING OF THE URL!");
            m_msghelper.msg("invoking against " + apicall);
            m_api_wikipediaSearch.Invoke <APIMASH_WikiPediaLib.APIMASH_OM>(apicall);
        }
        private void Invoke()
        {
            //string apicall = @"http://api.geonames.org/findNearbyWikipediaJSON?postalcode=33702&country=US&radius=10&username=demo";
            //m_msghelper.msg("invoking against " + apicall);
            //api_findNearbyPlaces.Invoke<APIMASH_WikiPediaLib.APIMASH_OM>(apicall);
            m_msghelper.clr();

            string _username = APIMASHGlobals.Instance.UserID;

            if (_username.Length <= 0)
            {
                MessageDialogHelper.ShowMsg("username", "valid geonames username is required to be set, use the CHARMS=>SETTINGS menu to enter yours");
                return;
            }

            int _zip = 0;

            try
            {
                _zip = System.Convert.ToInt32(TextBox_SearchFor.Text);
            }
            catch
            {
                MessageDialogHelper.ShowMsg("oops", "postalcode must be all numeric");
                return;
            }

            FindNearbyWikipediaHelper _apihelper = new FindNearbyWikipediaHelper(_zip, "US", 10, _username);
            string _apicall = _apihelper.TargetURL;

            System.Diagnostics.Debug.WriteLine("TargetURL=" + _apicall);

            m_msghelper.msg("invoking against " + _apicall);
            api_findNearbyPlaces.Invoke <APIMASH_WikiPediaLib.APIMASH_OM>(_apicall);
        }
Exemplo n.º 3
0
        private void Invoke()
        {
            //string apicall = @"http://api.geonames.org/wikipediaBoundingBoxJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=devfish";
            string _username = APIMASHGlobals.Instance.UserID;

            if (_username.Length <= 0)
            {
                MessageDialogHelper.ShowMsg("username", "valid geonames username is required to be set, use the CHARMS=>SETTINGS menu to enter yours");
                return;
            }

            WikipediaBoundingBoxHelper _apihelper = new WikipediaBoundingBoxHelper(_username, 44.2, -10, -22.5, 55.3);

            string _apicall = _apihelper.TargetURL;

            System.Diagnostics.Debug.WriteLine("TargetURL=" + _apicall);

            m_msghelper.msg("invoking against " + _apicall);
            api_findNearbyPlaces.Invoke <APIMASH_WikiPediaLib.APIMASH_OM>(_apicall);
        }
Exemplo n.º 4
0
        private void Invoke()
        {
            m_msghelper.clr();
            m_msghelper.msg(System.DateTime.Now.ToString() + " : " + "Invoke()");

            //string apicall = @"http://api.geonames.org/wikipediaBoundingBoxJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=devfish";
            string _username = APIMASHGlobals.Instance.UserID;

            if (_username.Length <= 0)
            {
                MessageDialogHelper.ShowMsg("username", "valid geonames username is required to be set, use the CHARMS=>SETTINGS menu to enter yours");
                return;
            }

            double _latUL = 0.0;
            double _lonUL = 0.0;
            double _lonLR = 0.0;
            double _latLR = 0.0;

            try
            {
                _latUL = System.Convert.ToDouble(TextBox_LatUL.Text);
                _lonUL = System.Convert.ToDouble(TextBox_LonUL.Text);
                _latLR = System.Convert.ToDouble(TextBox_LatLR.Text);
                _lonLR = System.Convert.ToDouble(TextBox_LonLR.Text);
            }
            catch
            {
                m_msghelper.msg("one of the latlon pairs is in invalid format");
                return;
            }

            WikipediaBoundingBoxHelper _apihelper = new WikipediaBoundingBoxHelper(_username, _latUL, _latLR, _lonUL, _lonLR);

            string _apicall = _apihelper.TargetURL;

            System.Diagnostics.Debug.WriteLine("TargetURL=" + _apicall);

            m_msghelper.msg("invoking against " + _apicall);
            api_findNearbyPlaces.Invoke <APIMASH_WikiPediaLib.APIMASH_OM>(_apicall);
        }
        private void Invoke()
        {
            m_msghelper.clr();
            m_msghelper.msg(System.DateTime.Now.ToString() + " : initiated");

            string _username = APIMASHGlobals.Instance.UserID;

            if (_username.Length <= 0)
            {
                MessageDialogHelper.ShowMsg("username", "valid geonames username is required to be set, use the CHARMS=>SETTINGS menu to enter yours");
                return;
            }

            WikipediaSearchHelper _apihelper = new WikipediaSearchHelper(_username, "Orlando", 50);

            string _apicall = _apihelper.FullTextSearchUrl(TextBlock_SearchFor.Text);

            System.Diagnostics.Debug.WriteLine("TargetURL=" + _apicall);

            m_msghelper.msg("invoking against " + _apicall);
            m_api_wikipediaSearch.Invoke <APIMASH_WikiPediaLib.APIMASH_OM>(_apicall);
        }