nimrod-pastebin

I’ve been working on more projects to help teach myself to program in Nimrod, and this is the result of one of them. It’s a Nimrod wrapper for the Pastebin API. Currently it  has the following functions:

  • createPaste() – creates a new paste.
  • createPasteFromFile() – creates a new paste from the contents of a file.
  • createAPIUserKey() – creates a user session key, for use with other functions.
  • listUserPastes() – lists a user’s pastes.
  • listTrendingPastes() – lists the top 18 trending pastes.
  • deletePaste() – deletes a paste.
  • getUserInfo() – gets information about a user.
  • getPaste() – gets the contents of a paste.
  • getPasteToFile() – gets the contents of a paste and writes it to a file.

There are two functions I haven’t yet finished (listTrendingPastes() and listUserPastes()), but that’s just because Nimrod’s XML parsing modules are missing some pretty important functionality, and I’ll add them as soon as I figure out a way around that limitation. (There’s no ability to get the value of a Node, for example.)

EDIT: Turns out the functionality is there, but there are two method for working with XML and the documentation isn’t the clearest thing in the world. Back to work…

EDIT2: And all done.

In addition to the functions, there are two other modules, one (pastebin_constants.nim) that contains constants for privacy values and expiration dates and another (pastebin_formats.nim) that contains constants for the formats used for syntax highlighting.

The code is on GitHub, but I haven’t quite finished the documentation yet.

Advertisements

Rock Collector update, Sept 27

I really haven’t been working on this much, but I’m going to start in on it again.

Changes

  • Finished menu accelerators.
  • Moved the UI data to a file in the resources directory.
  • Added comments and a bunch of non-code stuff.
  • File -> Quit now works.

As you can see, I’ve made a huge amount of progress…

WeatherLog 1.4

What’s Changed?

  • Minor improvements:
    • Moved the order of the buttons in some window to an order that makes more sense.
    • Removed use of the older program name. (Oops.)
    • In the General Info window, renamed the Number of Days field to Range of Days, and added a new, accurate Number of Days field.
    • Renamed the “Category” label in the Info windows to “Field”.
    • Fixed bug where the Yahoo! Weather API would return an empty string for the wind direction/speed and cause an error when pre-filling data.
    • When exporting data it is now converted to HTML or CSV after the file has been chosen, instead of before.
    • Some windows can no longer be resized.
    • Updated a lot of the help, and added a new section for the command line arguments.
  • New features:
    • Added Export button to the Info windows, for exporting the info data to an HTML file.
    • Added command line argument “window_size”.

Download

Downloads can be found on the SourceForge page, and the code is available on Github.

WeatherLog 1.3

What’s Changed?

  • Minor improvements:
    • Added error checking to see if a profile exists, and if it doesn’t either load or create the default one.
    • Clear All no longer requires a restart.
    • Added a Reset button in the Options window for easily setting the options to the default values.
    • Bugfixes!
  • Code improvements:
    • Updated to python-weather-api 0.3.6.

Download

Downloads can be found on the SourceForge page, and the code is available on Github.

WeatherLog 1.2.1

What’s Changed?

  • Minor improvements:
    • Improved Add Profile function.
    • Fixed bug where creating a new profile and immediately closing the application without adding any data would result in not being able to open the profile later.
    • Added keybinding for Import and Merge.
    • Added keyboard shortcuts for top-level menus.
  • New features:
    • Added command line arguments “switch_profile”, “add_profile”, and “remove_profile”.
  • Code improvements:
    • Renamed duplicate menu variables.

Download

Downloads can be found on the SourceForge page, and the code is available on Github.