Sha256: 341a738f4f68370a695581345651746794450bdd2effcae0c7993a097489597a

Contents?: true

Size: 774 Bytes

Versions: 19

Compression:

Stored size: 774 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'headdesk'
require 'nokogiri'
require 'open-uri'
require 'yaml'

html_doc = Nokogiri::HTML(open('https://developers.facebook.com/docs/android/change-log-4x'))

facebook_sdk_versions = html_doc.xpath('//h2')
                                .select { |h2| h2.attributes['id'].value =~ /^\d+_\d+_\d+$/ }
                                .collect do |h2|
  major, minor, patch, date = h2.text.match(/^(\d+)\.(\d+)\.?(\d+)? \- (.*)$/).captures
  {
    major: major.to_i || 0,
    minor: minor.to_i || 0,
    patch: patch.to_i || 0,
    version: "#{major.to_i || 0}.#{minor.to_i || 0}.#{patch.to_i || 0}",
    date: Date.parse(date)
  }
end

File.write(Headdesk::FACEBOOK_SDK_VERSIONS_YAML, facebook_sdk_versions.to_yaml)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
headdesk-0.14.0 bin/facebook_sdk_versions
headdesk-0.13.0 bin/facebook_sdk_versions
headdesk-0.12.0 bin/facebook_sdk_versions
headdesk-0.11.3 bin/facebook_sdk_versions
headdesk-0.11.2 bin/facebook_sdk_versions
headdesk-0.11.1 bin/facebook_sdk_versions
headdesk-0.11.0 bin/facebook_sdk_versions
headdesk-0.10.0 bin/facebook_sdk_versions
headdesk-0.9.0 bin/facebook_sdk_versions
headdesk-0.8.0 bin/facebook_sdk_versions
headdesk-0.7.0 bin/facebook_sdk_versions
headdesk-0.6.0 bin/facebook_sdk_versions
headdesk-0.5.2 bin/facebook_sdk_versions
headdesk-0.5.1 bin/facebook_sdk_versions
headdesk-0.5.0 bin/facebook_sdk_versions
headdesk-0.4.0 bin/facebook_sdk_versions
headdesk-0.3.0 bin/facebook_sdk_versions
headdesk-0.2.0 bin/facebook_sdk_versions
headdesk-0.1.0 bin/facebook_sdk_versions