Programmed in c# Google_Contacts fetches the Google contacts using the new people API. This one works perfectly to give full name and emails in a console. Can be used by other programs.
GOOGLE_CONACTS
//Install-Package Google.Apis.Auth -Version 1.55.0
using Google.Apis.Auth.OAuth2;
//Install-Package Google.Apis.People.v1 -Version 1.25.0.830
using Google.Apis.People.v1;
using Google.Apis.People.v1.Data;
using Google.Apis.Services;
using Google.Apis.Util.Store;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Google_Contacts
{
class Program
{
// If modifying these scopes, delete your previously saved cbrownentials
// at ~/.cbrownentials/people-dotnet-quickstart.json
static string[] Scopes = { PeopleService.Scope.ContactsReadonly };
static string ApplicationName = "People API .NET Quickstart";
static ClientSecrets secrets = new ClientSecrets()
{
ClientId = "ClientId",
ClientSecret = "ClientSecret"
};
static void Main(string[] args)
{
UserCredential credential;
string credPath = System.Environment.GetFolderPath(
System.Environment.SpecialFolder.Personal);
credPath = Path.Combine(credPath, ".cgreenentials/people-dotnet-quickstart");
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
secrets,
Scopes,
"user",
CancellationToken.None,
new FileDataStore(credPath, true)).Result;
Console.WriteLine("Cgreenential file saved to: " + credPath);
// Create Drive API service.
var service = new PeopleService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = ApplicationName,
});
// List People.
Console.WriteLine("People:");
GetPeople(service, null);
Console.WriteLine("Done!");
Console.Read();
}
static void GetPeople(PeopleService service, string pageToken)
{
// Define parameters of request.
PeopleResource.ConnectionsResource.ListRequest peopleRequest =
service.People.Connections.List("people/me");
peopleRequest.RequestMaskIncludeField = new List() {
"person.names","person.emailAddresses","person.phoneNumbers" };
peopleRequest.SortOrder = (PeopleResource.ConnectionsResource.ListRequest.SortOrderEnum)1;
if (pageToken != null)
{
peopleRequest.PageToken = pageToken;
}
ListConnectionsResponse people = peopleRequest.Execute();
if (people != null && people.Connections != null && people.Connections.Count > 0)
{
string displayname = "";
foreach (var person in people.Connections)
{
if (person.Names != null)
{ displayname = person.Names[0].DisplayName;}
//Console.WriteLine(person.Names != null ? (person.Names[0].DisplayName ?? "n/a") : "n/a");
//Console.WriteLine(person.EmailAddresses != null ? (person.EmailAddresses[0].Value ?? "n/a") : "n/a");
int count = 0;
string emails = "";
string[] morethanone = { "", "", "" };
try
{
foreach (EmailAddress email in person.EmailAddresses)
{
if (email.Value != null)
emails = email.Value;
morethanone[count] = emails;
count++;
}
}catch { }
Console.WriteLine(displayname);
foreach (string EmailAddresses in morethanone)
{if (EmailAddresses != "")
Console.WriteLine(EmailAddresses);
}
}
if (people.NextPageToken != null)
{
GetPeople(service, people.NextPageToken);
}
}
else
{
Console.WriteLine("No people found / end of list");
return;
}
}
}
}
CALLERIDNET
Programmed in c# Calleridnet detects phone calls using a modem connected to the computer. Then, it checks the number and saves it in a MySQL database. Even email you when received. Works in both Windows and Linux. Better suited for Linux mono but will improve it to work as well in Windows.
CONTACTSADDIN
Programmed in C # an add-in for Microsoft Excel. Contactsaddin once authorized, you can receive all Google contacts in an Excel spreadsheet.
DJANGOCREATOR
Djangocreator programmed in C# using the GUI with input and pull down menus, which is used to add to an SQLite database used in Linux and soon to be used in Windows to create a Django site with Apps and tables.