Tag Archives: bing.com

GMap.NET component : Moving Marker

WTH is GMap.NET?

Simply put: it’s an open source .net component that can show online mapping service (such as Google Map, Bing Map, OpenStreetMap) in your .NET app.
Download the binary here: http://greatmaps.codeplex.com/
Extract it. You’ll get the .net 2.0 and .net 4.0 version, since I’m using VS 2015, we’ll use the .net 4.0 version.

What will we do now is about how to move a marker inside the map (for tracking/visualizing object movement, etc). We’ll just move the marker randomly in this tutorial.

  • Create new VB Windows Form project
  • Add GMap.NET component into your project reference
GMap.NET component reference

GMap.NET component reference

  • Add GMap.NET component into your toolbar.
Add GMap.NET component step 1

Add GMap.NET component step 1

Add GMap.NET component step 2

Add GMap.NET component step 2

  • Now drag and drop the GMap.NET control into your Form, I name it myMap
  • We’ll also add another controls: 1 Button (name: btnMove), 1 Timer (name: tmr1), 1 Label (name: lblInfo)
List of components

List of components

I also add new bitmap resource into our project properties. This will be used as our marker symbol.

Resource for marker symbol

Resource for marker symbol

You can see the Form’s full source code at the bottom of this post. I’ll just point out some important parts:

  • Map initialization is on Form1_Load event code (zoom level, initial position, provider used, marker type, etc)
  • When you click on the btnMove, it’ll start generating new random position for our marker. The random change is happened in the timer event (tmr1_Tick)
  • The process to update the map visual is delegated into function update_map(), so it will run in different thread and the form still responsive
  • In this tutorial, we are using BingSatelliteMapProvider, you can use another provider such as GoogleMapProvider or OviSatelliteMapProvider. Just see MapProviders namespace to see all supported providers.

Running the app

Running the app


Here’s the full source code:

Script to check the last date when Bing.com bot is indexing your site

On previous post, I create PHP script to check how many pages from your site is indexed in Bing.com search engine as part of fixing my old SEO statistic checker library. Now, we will check recent date where Bing.com search engine bot indexing your site. We will use scraping technique again, so, we can save our Azure Datamarket quota. How’s this useful for you? Well, it measured how much love Bing.com gave to your site.. 😛

bing.com bot query

Without more talk, here’s the full PHP source code:

Same as before, no fancy coding here. You can improve the data processing by using regular expression. You may ask, why we need to create our own file_get_contents as helper function, PHP already had one? You got it, we can use built-in file_get_contents function if we want. The reason why I create our own file_get_contents is to fool Search Engine that our query is legit and look natural (you know, we are doing illegal thing here –scraping search engine result– 👿 ). The other thing is that cURL has so many options that easily been set to our purpose (sure you can create stream context for built-in file_get_contents but is not that easy to understand to create it) .

How to use it:

Example result:

Fully working demo can be tested on: http://www.vrank.org/ on “Bing.com Bot” section.
As you can see, Bing.com bot is not really accurate. It only mention the date, Googlebot has more detailed info such as the time. Remember that the result might be different depending on your server location (where you run the script).

Script to check how many pages from a site is indexed in Bing.com

OK, this is part of what I’m doing to fix my old script (php pagerank checker and sh*t). I noticed that my Bing.com indexed page checker and Bing.com bot last access checker did not work anymore. It was because I’m not using Bing.com API at all to get the data. Instead, I do  some simple scraping on Bing.com search result page. (So, I’m not calling any Azure Datamarket API here)

Without more a do, this is the full PHP script code:

No fancy and advanced code there, just simple cut and grab. You might consider using regex when parsing the search results from Bing.com

How to use it

The result would be in integer (0 if Bing.com hasn’t indexed any of your site’s pages).

Fully working demo can be seen here: http://www.vrank.org on “Bing.com Indexed” part.

bing indexed page in search result

this is how you check how many your site’s pages are indexed by Bing.com

As you can see that the result may vary depending on your location (or where you put the script) and sometimes, Bing.com gave invalid result (such as 0, where the real value might be higher than that)

Check your Windows Azure Datamarket remaining quota

In my previous post, I show you how to use Windows Azure Datamarket to create a Bing Search Engine Position checker. I told you that for free account, you only have 5000 requests per month. Paid subscription has higher limit.
This time I’ll show you how to check your remaining monthly quota for all of your Windows Azure Datamarket subscription without logging in to Azure Datamarket. This is the main function:

How to call it:

Example result:

Fully working demo: http://demo.ahowto.net/bing_quota/

check remaining quota in Windows Azure Datamarket

example output formatted as table

Notes:

  1. The function will check ALL of your Windows Azure Datamarket subscription
  2. checking your quota does not subtract your quota
  3. your PHP version must be at least 5.2 and PHP-openssl module must be activated

[php] New Bing SERP checker using Windows Azure Datamarket

So, I got email from Bing Developer Team informing that Bing Search API 2.0 will be gone and moving to new platform: Windows Azure Datamarket. On my previous Bing SERP checker project, I’m using Bing Search API 2.0 which means that those codes will no longer working after 1st August.

Windows Azure Datamarket provide a trial package and a free package that has limit for 5000 requests per month. More than enough for us to toying for Bing SERP checker.

Go get your Account Key (was Application ID) : https://datamarket.azure.com/

This is the revised main function php codes so it will work on new Windows Azure Datamarket web service

How you call it:

Example output:

Fully working demo: http://demo.ahowto.net/new_bserp/

Actually, there are a lot of other “Search Market” that supported by Bing but I only listed some of them just for example. Download this document for complete list of Bing’s supported Search Market: http://www.bing.com/webmaster/content/developers/ADM_SCHEMA_GUIDE.docx

Notes:

  1. Your PHP version must be PHP 5.2 or higher (because of json_decode command)
  2. You must activate PHP OpenSSL module (php_openssl) because we are using file_get_contents and the webservice end point must be accessed via HTTPS

Update (2012-07-20) : the endpoint URL is changed