#Stuck #App #Roadside assistance in #Australia @stuck_app

December 3, 2016 Leave a comment

Screen Shot 2016-12-03 at 14.05.58.png

Stuck is a new app for Australian drivers which you can download for iOS or Android via their website here;https://stuck.com.au/

Stuck is an on-demand service which calls local automotive experts to the rescue, saving you an annual insurance-style roadside assistance membership. Here’s how it works:

1. Share your required service and location with local, accredited automotive experts. The nearest available expert will arrive to help as soon as possible.

2. You are given the price upfront, which is usually about half the cost of a normal annual membership. Any extras can be added on if required (such as a new tyre).

3. Once your car problem is resolved, payment happens automatically without paperwork. Finally, you provide feedback to the automotive expert and get going!

From a technical point of view, it uses our Australian Car Registration API http://www.carregistrationapi.com/

 

 

Categories: Uncategorized

#MachineLearning using #Microsoft Azure

December 2, 2016 Leave a comment

"1+1=3" handwritten with white chalk on a blackboard

Me: Azure , what is 1 + 1 ?

Azure: It’s 1.999999999992212

Me: No it’s not.

Azure: Come on, I’m almost right!

I’ve just been playing with the Azure Machine Learning Studio, to see if it could be accurate enough for practical applications. The most simple example I could think of was a model where it was given 1,000 examples of one number, followed by a second number which was one greater.

1,2
2,3
3,4

You can see the model in the Cortana Intellegence Gallery here
https://gallery.cortanaintelligence.com//Experiment/Plus-one-webservice-1

Interestingly, the result is not perfect as would be expected, but it goes wrong in a way that only a machine would think is close to the correct answer.

scored-dataset

 

 

Categories: Uncategorized

#Verify a #BankAccount via an #API

December 1, 2016 Leave a comment

screenshot

If you process large volumes of payments, then you will need to be able to quickly and cheaply check that the payment you are about to make is going to a valid bank account, or else it will delay payment to your supplier / employee / or affiliate, this API allows you to check each account for 3p / 4¢ – using the same technology as used by Stripe.

verifyBankAccount.com

 

Getting started

The API endpoint is located at https://verifybankaccount.com/api.asmx

It accepts GET / POST and SOAP requests, and returns either a HTTP 500 error with textual description on error, or JSON embedded in XML in the case of a valid response, similar to as follows:

<string xmlns=”http://verifybankaccount.com/”&gt;

{
 “id”: “ba_19LxhvI1fputaiwwXEZeaGit”,
 “object”: “bank_account”,
 “account”: “acct_198SNII1fxutaiww”,
 “account_holder_name”: null,
 “account_holder_type”: null,
 “bank_name”: “BOI UK PLC”,
 “country”: “GB”,
 “currency”: “gbp”,
 “default_for_currency”: true,
 “fingerprint”: “YiMK5qcuDQXGocsn”,
 “last4”: “2674”,
 “metadata”: {
   
 },
 “routing_number”: “90-49-74”,
 “status”: “new”,
 “name”: null
}

</string>

Countries supported by this API are as follows;

Country code
US USA
IE Ireland
GB United Kingdom
AU Australia
CA Canada
DK Denmark
FI Finland
FR France
JP Japan
NO Norway
SG Singapore
ES Spain
SE Sweden
AT Austria
BE Belgium
DE Germany
HK Hong Kong
IT Italy
LU Luxembourg
NL Netherlands
PT Portugal

The API also includes an endpoint for programmatically retrieving the remaining credits associated with an API Key, called  GetRemainingCredit returning data such as;

<int xmlns=”http://verifybankaccount.com/”>98</int&gt;

C# (.NET) implementation

Here is a step by step guide to writing a simple C# client

  • Open Visual Studio
  • Press File > New > Project
  • Select Console Application – Visual C#
  • Press OK
  • Right Click on the project in Solution Explorer
  • Select Add > Service Reference
  • Click Advanced
  • Click Add Web Reference
  • Enter “https://www.verifybankaccount.com/api.asmx?wsdl” into the URL
  • Press Add Reference
  • Click Tools > NuGet Package Manager > Package Manager Console
  • Type “Install-Package Newtonsoft.JSON” into the Package Manager Console window
  • Now, enter the following code (Replacing the API KEY)
       static void Main(string[] args)

       {

           var strAPIKey = “Your API key here“;

           var bank = new com.verifybankaccount.www.API();

           Console.WriteLine(“Enter the 2 letter country code:”);

           var strCountry = Console.ReadLine();

           Console.WriteLine(“Enter the Bank sort code:”);

           var strSortCode = Console.ReadLine();

           Console.WriteLine(“Enter the Bank account number:”);

           var strAccountNumber = Console.ReadLine();

           try

           {

               var strJson = bank.VerifyBankAccount(strCountry, strSortCode,

                                       strAccountNumber, strAPIKey);

               var jObject = Newtonsoft.Json.Linq.JObject.Parse(strJson);

               Console.WriteLine(“This bank is ” + jObject[“bank_name”]);

           }

           catch(Exception ex)

           {

               Console.WriteLine(ex.Message);

           }            

           Console.ReadKey();

       }

PHP Implementation

The following implementation uses the HTTP GET version of the webservice, you could use $soapclient as an alternative implementation. Please note that you should never pass bank account details over an unsecure connection so this code should be run either on localhost or on a suitably secured HTTPS webserver.

You will have to replace the APIKey below

<?php

$country = $_GET[“country”];

$sortcode = $_GET[“sortcode”];

$accountNumber = $_GET[“accountNumber”];

$url = “https://www.verifybankaccount.com/api.asmx /VerifyBankAccount?”;

$url .= “Country=” . $country;

$url .= “&SortCode=” . $sortcode;

$url .= “&AccountNumber=” . $accountNumber;

$url .= “&ApiKey={{Your API Key}}“;

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$xmlData = curl_exec($ch);

libxml_use_internal_errors(true);

$xml=simplexml_load_string($xmlData);

if ($xml) {

$json = json_decode($xml);

print_r($json->bank_name);

}

else

{

print_r($xmlData);

}

?>

 

Categories: Uncategorized

Unofficial #Google #PlayStore #API, in #JSON

November 30, 2016 Leave a comment

descargar-google-play-store

 

Unofficial Android App Store API

This API is not affiliated with Google, it reads from a database that contains a copy of the Google Play Store, and may not be completely up to date, but is updated regularly. As such, the API is free to use, but we’d appreciate a thank you.

 Usage – Via HTTP GET request

The API is requested using the following query string:

http://www.androidappstore.com.cn/playstoreapi/api.aspx?search=angry%20birds

Where “Angry birds” is a sample placeholder.

A sample response in JSON would be as follows;

[
 {
   “ID”: 85052,
   “imageUrl”: “https:\/\/lh6.ggpht.com\/M9q_Zs_CRt2rbA41nTMhrPqiBxhUEUN8Z1f_mn9m89_TiHbIbUF8hjnc_zwevvLsRIJy=w300”,
   “Name”: “Angry Birds”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “4040062”,
   “AppSize”: “48”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/85052\/PlayStore\/angry-birds”
 },
 {
   “ID”: 85080,
   “imageUrl”: “https:\/\/lh3.googleusercontent.com\/0vquFcjLdlClPFZlnq3S-kNSyYWyc4MkYwluIfMPHf92QYL8s9rOfozPiG7RQ-7bfQ3R=w300”,
   “Name”: “Angry Birds Go!”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_RACING”,
   “Price”: “0”,
   “Reviewers”: “2695984”,
   “AppSize”: “152”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/85080\/PlayStore\/angry-birds-go”
 },
 {
   “ID”: 85085,
   “imageUrl”: “https:\/\/lh5.ggpht.com\/rp_WwrHlSIfiDD2w4P6qZf-WXK2XLAn8MXqxZhdteCHIN0I53Po9pXS8lUjFKANLnA=w300”,
   “Name”: “Angry Birds Rio”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “1730826”,
   “AppSize”: “48”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/85085\/PlayStore\/angry-birds-rio”
 },
 {
   “ID”: 85196,
   “imageUrl”: “https:\/\/lh5.ggpht.com\/CXqjoN_u3sFyV_Z1M7E-4KmyI0tYe5FLHV5KosQC-0s5LsZuhm4omg-5nP6VBpIwilI=w300”,
   “Name”: “Angry Birds Space”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “1049597”,
   “AppSize”: “48”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/85196\/PlayStore\/angry-birds-space”
 },
 {
   “ID”: 85328,
   “imageUrl”: “https:\/\/lh5.ggpht.com\/5lsYulxyO1ENBxp89y_vVLI6FwYX5BStQRCLUHKuFl67vWsFwIkSH2YCez7WFGi-eto=w300”,
   “Name”: “Angry Birds Seasons”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “1426544”,
   “AppSize”: “44”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/85328\/PlayStore\/angry-birds-seasons”
 },
 {
   “ID”: 85443,
   “imageUrl”: “https:\/\/lh6.ggpht.com\/mFp9bta4gxoHiVhJ25Q8RjSJRcu7Yn19yIYGhgHuwDfCyUjhSez7G4nsEC-nscCF9TE=w300”,
   “Name”: “Angry Birds Friends”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “477116”,
   “AppSize”: “35”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/85443\/PlayStore\/angry-birds-friends”
 },
 {
   “ID”: 85460,
   “imageUrl”: “https:\/\/lh6.ggpht.com\/JMKJB1_VXk8rH7Kzz_2BPKprT61oMp_Xp768Xbdm-OWa-PWtdsdq55I0DZPZYbNWjC0=w300”,
   “Name”: “Angry Birds Star Wars”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “875156”,
   “AppSize”: “46”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/85460\/PlayStore\/angry-birds-star-wars”
 },
 {
   “ID”: 90472,
   “imageUrl”: “https:\/\/lh6.ggpht.com\/wQMavK-tiAYOnlK4hXwX2fdDET3xWfQIl3sCOQegMszI5CKlWOgXwEot7vChcKSOIXo=w300”,
   “Name”: “Angry Birds Transformers”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “818959”,
   “AppSize”: “109”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/90472\/PlayStore\/angry-birds-transformers”
 },
 {
   “ID”: 90495,
   “imageUrl”: “https:\/\/lh5.ggpht.com\/kSBf57npbQNutgfzvXL7x6Nl95LAQeUTKkCRVWqquOJ6T4IppoKAlfuUgNI1vk6Bc_4=w300”,
   “Name”: “Angry Birds Stella”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “451535”,
   “AppSize”: “49”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/90495\/PlayStore\/angry-birds-stella”
 },
 {
   “ID”: 90523,
   “imageUrl”: “https:\/\/lh5.ggpht.com\/Ju6Su5337-hEXaKsZO4aZEH1H7M_Izu3FoKBSzoF93CbhICXYcISYruOW4ulGBeEIS4=w300”,
   “Name”: “Angry Birds Star Wars II Free”,
   “Developer”: “Rovio Entertainment Ltd.”,
   “IsTopDeveloper”: “False”,
   “Category”: “\/store\/apps\/category\/GAME_ARCADE”,
   “Price”: “0”,
   “Reviewers”: “898573”,
   “AppSize”: “49”,
   “source”: “PlayStore”,
   “url”: “http:\/\/www.androidappstore.com.cn\/EN\/displayproduct\/90523\/PlayStore\/angry-birds-star-wars-ii-free”
 }
]

 

Categories: Uncategorized

#Car Registration #API now extended to cover #Pakistan (#Punjab #Khyber #Gilgit)

November 30, 2016 Leave a comment

2214126519_c46882df22

Our API at http://pk.carregistrationapi.com has now been extended to serve an additional 214 million people in Pakistan. Covering the Punjab, Khyber and Gilgit provinces. You can use the API to look up vehicle details and vehicle owner details by supplying a number plate and state.

Pakistan support

Car registration plates in Pakistan  use the /CheckPakistan endpoint and return the following information:

  • Make & Model
  • VIN number
  • Age
  • Engine number
  • Owner information
  • Representative image

Currently, 3 provinces of Pakistan are supported, Punjab (PB), Khyber Pakhtunkhwa (KP), and Gilgit–Baltistan (GB). You must provide the province / state value as “PB”, “KP”, or “GB”. additionally, each province returns different data as follows

Punjab Province

Sample Json:

{
 “Description”: “EXCLUSIVE”,
 “CarMake”: {
   “CurrentTextValue”: “CHEVROLET”
 },
 “CarModel”: {
   “CurrentTextValue”: “EXCLUSIVE”
 },
 “MakeDescription”: {
   “CurrentTextValue”: “CHEVROLET”
 },
 “ModelDescription”: {
   “CurrentTextValue”: “EXCLUSIVE”
 },
 “VechileIdentificationNumber”: “KL14M11BE5C108055”,
 “RegistrationYear”: 2005,
 “Image”: “http:\/\/pk.carregistrationapi.com\/image.aspx\/@Q0hFVlJPTEVUIEVYQ0xVU0lWRQ==”,
 “Extended”: [
   {
     “Key”: “Registration Number”,
     “Value”: “LZR 996”
   },
   {
     “Key”: “Chassis Number”,
     “Value”: “KL14M11BE5C108055”
   },
   {
     “Key”: “Engine Number”,
     “Value”: “F8CV321778K”
   },
   {
     “Key”: “Make Name”,
     “Value”: “CHEVROLET – EXCLUSIVE-LS”
   },
   {
     “Key”: “Registration Date”,
     “Value”: “22-Jul-2005 12:00 AM”
   },
   {
     “Key”: “Model”,
     “Value”: “2005”
   },
   {
     “Key”: “Vehicle Price”,
     “Value”: “555,000”
   },
   {
     “Key”: “Color”,
     “Value”: “P.BLACK”
   },
   {
     “Key”: “Token Tax Paid upto”,
     “Value”: “LIFETIME”
   },
   {
     “Key”: “Owner Name”,
     “Value”: “MUHAMAMD ZAHID HANIF”
   },
   {
     “Key”: “Father Name”,
     “Value”: “MUHAMMAD HANIF”
   },
   {
     “Key”: “Owner City”,
     “Value”: “LAHORE”
   }
 ]
}

Khyber-Pakhtunkhwa province

For the Khyber-Pakhtunkhwa province “KP”, you will need to also provide the district where the vehicle was registered, which can be one of; Abbottabad, Bannu, Battagram, Buner,Charsadda,Chitral,Dera Ismail Khan,Hangu,Haripur,Karak,Kohat,Kohistan,Lakki Marwat,Lower Dir (PATA), Malakand (PATA), Mansehra, Mardan, Nowshera, Peshawar,Shangla,Swabi,Swat,Tank,Tor Ghar or Upper Dir.

Sample Json:

{
 “Description”: “HERO RF70”,
 “CarMake”: {
   “CurrentTextValue”: “HERO RF70”
 },
 “MakeDescription”: {
   “CurrentTextValue”: “HERO RF70”
 },
 “VechileIdentificationNumber”: “266991”,
 “RegistrationYear”: “2011”,
 “Image”: “http:\/\/pk.carregistrationapi.com\/image.aspx\/@SEVSTyBSRjcwfG1vdG9yY3ljbGU=”,
 “Extended”: [
   {
     “Key”: “Vehicle Registration Number”,
     “Value”: “B 9838”
   },
   {
     “Key”: “Maker Name”,
     “Value”: “HERO RF70”
   },
   {
     “Key”: “Model”,
     “Value”: “2011”
   },
   {
     “Key”: “Chasis Number”,
     “Value”: “266991”
   },
   {
     “Key”: “Engine Number”,
     “Value”: “266991”
   },
   {
     “Key”: “Owner Name”,
     “Value”: “ALI RAZA”
   },
   {
     “Key”: “Owner Father Name”,
     “Value”: “ABDUR RASHEED”
   },
   {
     “Key”: “Color”,
     “Value”: “Red”
   }
 ]
}

Gilgit–Baltistan Province

Sample Json:

{
 “Description”: “L.Cruiser”,
 “CarMake”: {
   “CurrentTextValue”: “L.Cruiser”
 },
 “MakeDescription”: {
   “CurrentTextValue”: “L.Cruiser”
 },
 “VechileIdentificationNumber”: “BJ-70-0002425”,
 “RegistrationYear”: 1990,
 “Image”: “http:\/\/pk.carregistrationapi.com\/image.aspx\/@TC5DcnVpc2VyfG1vdG9yY3ljbGU=”,
 “Extended”: [
   {
     “Key”: “Reg.No”,
     “Value”: “GZR-1”
   },
   {
     “Key”: “ChassisNo.”,
     “Value”: “BJ-70-0002425”
   },
   {
     “Key”: “EngineNo.”,
     “Value”: “3B-0722423”
   },
   {
     “Key”: “MakeType”,
     “Value”: “L.Cruiser”
   },
   {
     “Key”: “Reg.Date”,
     “Value”: “7\/10\/1990”
   },
   {
     “Key”: “YearOFManufacture”,
     “Value”: “1985”
   },
   {
     “Key”: “OwnerName”,
     “Value”: “Pir Karam Ali Shah”
   },
   {
     “Key”: “OwnerFatherName”,
     “Value”: ” Nadar Alam”
   },
   {
     “Key”: “OwnerAddress”,
     “Value”: “Village Majini Mohallah Gilgit”
   }
 ]
}

Categories: Uncategorized

Generate a #Facebook #AccessToken that never expires

November 29, 2016 Leave a comment

fb

I thought this was a very useful step by step guide to generating an access token in Facebook that never expires:

Steps for Creating Never Expire Page Access Token.

  1. Go To link https://developers.facebook.com/
  2. Login with your facebook Credential
  3. Go to Right upper Menu My Apps Select Add New App / Create New App
  4. After Creating a New App you have redirect to App Dashboard page
  5. Click on Dashboard you see App Id and App Secret
  6. Now You Go to App Review from the left menu. Make App Public.
  7. Now you go to Tools and Support menu
  8. Select Graph API Explorer
  9. Now at Right Upper Corner. Select Your Application. By default, “Graph Api Explorer” selected
  1. Now Click on Get Token Button. And then you see three option.
  2. Select “Get User Access Token” Popup open, Select  manage_pages and publish_pages Checkboxes and click on “Get Access Token” Button.
  3. Now Again Click on Get Token Button Select Page Access Token choose your Page.
  4. After Selecting your page your short term Access token is generated. That is in the Access token textbox.
  1. Now Click Information button(blue i button) that is in left side near the Access Token label. One poupu open, now click on “Open in Access Token tool”
  1. Another tab is open. Now Click on Extend Access Token. Two month Access Token is generated
  1. Now go to previous tab Graph Api Explorer paste this extended token in the Access token toolbox.
  2. Add one parameter in “access_token” in the get toolbox so final string looks like “me?fields=id,name, access_token”
  3. Click on submit button. Your never expire token is generated in the response
  4. Copy this and check this access token paste on Access Token debugger.

And to finish off, here’s a code example in C# to post to a Facebook business page:

static async Task PostToFacebookAsync(string accessToken, string pageId)
{
// Use HttpClient
using (var client = new HttpClient())
{
// Set variable values for post to facebook
string uri = string.Format(“https://graph.facebook.com/{0}/feed?”,pageId);
var strName = HttpUtility.UrlEncode(result.Title + suffix);
var strLink = HttpUtility.UrlEncode(result.MediaUrl);
// Formulate querystring for graph post
StringContent queryString = new StringContent(“access_token=” + accessToken + “&message=Hello+World”);

// Post to facebook /{page-id}/feed edge
HttpResponseMessage response = await client.PostAsync(new Uri(uri), queryString);
if (response.IsSuccessStatusCode)
{
// Get the URI of the created resource.
string postId = await response.Content.ReadAsStringAsync();
Console.WriteLine(“Post Successfully: Your Post ID is: {0}”,postId);

}
else
{
Console.WriteLine(“Something Went Wrong”);

}
}
}

 

Categories: Uncategorized

Control a #Linux machine from C#

November 28, 2016 Leave a comment

windows-os-and-linux-os

If your architecture involves both Windows and Linux machines, and suddenly Apache crashes, or you otherwise lose contact with the Linux machine, then normally this requires a linux admin to go in, and restart services. But, you can also have your Windows machine remotely monitor these services, and kick them off itself.

  • Ok, this is a contrived situation, it’s more about if you’re a good c# programmer but are clueless around linux – like me.

Anyway, there’s a NuGET package which you can install using Install-Package SSH.NET,  then you can get C# to connect to your Linux server as follows

string strOut = “”;
// Install-Package SSH.NET
using (var client = new SshClient(“112.12.12.123”, “root”, “password”))
{
client.Connect();
var result = client.RunCommand(“/etc/init.d/httpd restart”);
strOut = result.Result;
client.Disconnect();
}
Console.WriteLine(strOut);
Console.ReadLine();

 

Categories: Uncategorized