GithubHelp home page GithubHelp logo

geocachingtoolbox's Introduction

Hi there 👋

My name is Piotr Krzemiński. I'm a software development engineer, passionate about software quality, automation and constant process improvement. I work full-stack, mainly with JVM languages and React. My programming languge of choice is Kotlin which I use for both backend and frontend, and which I try to spread through a local Kotlin User Group. I try my best to write clean, functional code.

In the open-source world, I own an ecosystem of projects for creating type-safe GitHub workflows:

How to reach me

Feel free to drop me a line via LinkedIn.

geocachingtoolbox's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

lploumen

geocachingtoolbox's Issues

Migrate to other testing framework(s)

The unit tests now use MSpec (Machine.Specifications) framework. This has two drawbacks:

A proposed unit testing framework is NUnit because it's probably the most popular one and has good multiplatform support.
For mocking - Moq?
For higher-level tests (integration, acceptance) one may consider SpecFlow. It seems to be supported by MonoDevelop.

Portability

As you wrote in the documentation:
Portability in terms of working on multiple platforms. Also development should be possible on various platforms.

I think it would be useful to design this library as PCL so that it can be use effortless on different platforms.
Do you plan to add support for Windows Phone ? The problem is HtmlAgilityPack does not support XPath syntax on WP ( = no SelectNodes method). An alternative would be to use HtmlAgilityPack with Linq syntax (What I've used in my lib).

Error connecting just after authorization

When trying to get user info just after authorization (entering PIN), I'm getting HTTP 401 error. But the tokens are written locally to files anyway, so if I run the program again and it doesn't authorize again - it connects fine.
To reproduce, make sure to remove your developer app from allowed applications for your Opencaching project, in order to enforce the full authorization process.

Add asynchronous API

All methods are now synchronous (blocking). One should consider creating an asynchronous counterpart of all client interfaces or just replace all synchronous ones with asynchronous. However, I think that the existence of sync calls is a good thing as it makes it simpler to use the library by the less advanced users.

Calls to service clients need generic method parameters

Calling some methods of Client requires stating a generic method parameter. E.g client.GetGeocacheDetails<GCGeocache>(newestFoundCache); instead of just client.GetGeocacheDetails(newestFoundCache);. The point was to enforce these methods to return object of proper types. Currently there's an abstract class called Client and two classes inheriting from it: GCClient and OCClient. I wanted GetGeocacheDetails(...) of each concrete class to return objects of types corresponding to the particular geocaching service, so OCClient.GetGeocacheDetails(...) should return OCGeocache instead of just an abstract Geocache. I didn't want to use casting where the function is used, hence such solution. There's probably a cleaner solution to this issue.

Date problem

When converting dates string to DateTime object, I think there can be some issue converting from certain format to another.
I faced a problem in the GetFoundGeocaches method:

In my case, dateText is "31 Dec 14".
var date = DateTime.ParseExact(dateText, "dd/MM/yyyy", CultureInfo.InvariantCulture);

Which gives :
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

Additional information: La chaîne n'a pas été reconnue en tant que DateTime valide.

It would maybe be better to use Parse instead of ParseExact.

Best regards,

Redesign access token store for Opencaching

For Opencaching's client, there's now a simple implementation of an access token store (AccessTokenStore) that takes care of remembering user tokens once he authenticated himself successfully. It's now just one store per all OCClients so it doesn't let multiple clients to work on different accounts. It's also not safe as the tokens are not encrypted, and probably they should be.

Upload the library to NuGet

If someone wants to build GTGUI project (or use it in his own application), it's necessary to clone this repo and add a reference to it's assembly. It would be much easier if the library was handled as any other dependency.

Unit tests

Hi,
Sorry to contact you using this channel (I don't have your email address).
How do you run the unit tests ? Do you need a special tool ?
Regards,

Improve error handling

In most cases, only happy cases are covered. Responses should be validated and appropriate exceptions thrown.

Use compression for HTTP responses from Geocaching.com

Right now, no compression is requested when sending a request to the Geocaching.com. It would be good to handle two basic types of compression: gzip and deflate. So one should add this header to inform the server that it can send compressed content to us:

getRequest.Headers.Add("Accept-Encoding: gzip,deflate");

and when the response comes, the code should be able to recognize which type of compression was used (HttpWebResponse.ContentEncoding) and decompress it.

Rethink fetching data form services and representing it as objects

Looking at simple objects like Geocaching or Log, they are now meant just to store information and basically do nothing else. It should be rethought if they should stay this way. Also, an assumption is sometimes made that if a given field is not fetched from the geocaching service, it's set to null. One should consider the whole concept of partial fetching of some objects - how it should be indicated and handled. This situation occurs mainly for Geocaching.com when on a given web page we often have access to limited set of information e.g. about a geocache (just its name) and any details can be downloaded only after opening the geocache's details page.

Prepare integration tests with Geocaching.com and OKAPI

This is especially for Geocaching.com: they sometimes change something in the HTML which can break our code. It would be good to have a mechanism which tells us which calls in Geocaching Toolbox got broken because of some changes on their side.

Issues to solve:

  • For testing read-only features (that only download data from the services), it may be hard to find a geocache and any other entities that remain unchanged at all.
  • For write features, one would have to create a dummy cache where one could send some dummy logs, but that might be hard to be approved by the reviewer.

Refactor client classes, divide into smaller classes

The clients (classes deriving from Client) are now god objects - they contain a lot of logic and are unreadable. They should be probably divided into several smaller classes, maybe one per operation. The interface of the classes should, however, stay the same. What we want to keep is this ease and clarity of calling functions, like: client.DoSomethingWith(geocache). So probably each method of the client will contain a call to some class responsible for this call. This way it will be easier to test and maintain them.

Retrieve details about trackables

I.e. various properties:

  • name
  • tracking number
  • owner
  • origin
  • when released
  • where it is now
  • current goal
  • photos
  • tracking history - a list of points where it was

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.