Skip to content

Commit

Permalink
Merge branch 'main' into fix-markdown-link-action-fail
Browse files Browse the repository at this point in the history
  • Loading branch information
jbampton authored Oct 13, 2024
2 parents 580c236 + e76ccbf commit f7b26b3
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
version: 2.1
orbs:
python: circleci/python@2.1.1
python: circleci/python@2.2.0
shellcheck: circleci/[email protected]
jobs:
build-python:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/gocolly/colly/v2 v2.1.0
github.com/spf13/pflag v1.0.5
github.com/urfave/cli/v2 v2.27.4
github.com/urfave/cli/v2 v2.27.5
)

require (
Expand All @@ -14,7 +14,7 @@ require (
github.com/antchfx/htmlquery v1.3.0 // indirect
github.com/antchfx/xmlquery v1.3.18 // indirect
github.com/antchfx/xpath v1.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/gobwas/glob v0.2.4-0.20180402141543-f00a7392b439 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -88,6 +90,8 @@ github.com/urfave/cli/v2 v2.27.3 h1:/POWahRmdh7uztQ3CYnaDddk0Rm90PyOgIxgW2rr41M=
github.com/urfave/cli/v2 v2.27.3/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ=
github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8=
github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ=
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw=
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
Expand Down
10 changes: 5 additions & 5 deletions macewindu/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/gin-gonic/gin v1.10.0
github.com/gocolly/colly/v2 v2.1.0
github.com/heroku/x v0.2.9
github.com/heroku/x v0.3.1
)

require (
Expand Down Expand Up @@ -42,10 +42,10 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
12 changes: 12 additions & 0 deletions macewindu/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ github.com/heroku/x v0.2.8 h1:LIs27r6JLYfdX/YHlfrxeYHIB6D6xzCVpLOW67HPoak=
github.com/heroku/x v0.2.8/go.mod h1:qABdrmuNeRt8yZrE75iBjFWufk910OScvfqQnTtSiIE=
github.com/heroku/x v0.2.9 h1:p/xOMqd8UukSHHZWjbl8mL37W9EvIgSo28elecSAoxI=
github.com/heroku/x v0.2.9/go.mod h1:P+4KVm/tawjAumGkGjzn8OnvxluMdpEPXvx6o7v3Vus=
github.com/heroku/x v0.3.0 h1:OxMPXyBImpBQxDPQWiyLl23+I3/hIQUrSSEtPuiSB4k=
github.com/heroku/x v0.3.0/go.mod h1:P+4KVm/tawjAumGkGjzn8OnvxluMdpEPXvx6o7v3Vus=
github.com/heroku/x v0.3.1 h1:1G5kruamLk9zUqjGQrTvfbg9ZfMTgifqQSr8LLl3r7c=
github.com/heroku/x v0.3.1/go.mod h1:TGhB/Wciq11LekW1ygoss8OTyM3cuQoOsj/H2dXHSuk=
github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
Expand Down Expand Up @@ -174,6 +178,8 @@ golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
Expand Down Expand Up @@ -201,6 +207,8 @@ golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -223,6 +231,8 @@ golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
Expand All @@ -240,6 +250,8 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
Expand Down
46 changes: 34 additions & 12 deletions seek/seek.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Parser

# Custom OptionParser ScriptOptions
class ScriptOptions
attr_accessor :keyword, :location, :range, :worktype, :delay, :time, :print_total, :lite, :classification, :subclassification, :categories
attr_accessor :keyword, :location, :range, :worktype, :delay, :time, :print_total, :lite, :classification, :subclassification, :categories, :discard_salary

def define_options(parser)
parser.banner = "Usage: #{Paint['seek.rb [options]', :red, :white]}"
Expand All @@ -74,6 +74,7 @@ def define_options(parser)
execute_at_time_option(parser)
print_total_number_option(parser)
lite_option(parser)
discard_salary_option(parser)
categories_option(parser)

parser.separator ""
Expand Down Expand Up @@ -169,14 +170,26 @@ def print_total_number_option(parser)

def lite_option(parser)
parser.on("--lite [BOOLEAN]", "If BOOLEAN is true or 'yes', do not include the content column in the CSV") do |value|
self.lite = case value
when TrueClass, "yes", "Yes", "YES"
true
when FalseClass, NilClass, "no", "No", "NO"
false
else
value.to_s.casecmp("true").zero? || value.to_s.casecmp("yes").zero?
end
self.lite = parse_boolean_option(value)
end
end

def discard_salary_option(parser)
parser.on("--discard-salary [BOOLEAN]", "If BOOLEAN is true or 'yes', do not include the salary column in the CSV") do |value|
self.discard_salary = parse_boolean_option(value)
end
end

private

def parse_boolean_option(value)
case value
when TrueClass, "yes", "Yes", "YES"
true
when FalseClass, NilClass, "no", "No", "NO"
false
else
value.to_s.casecmp("true").zero? || value.to_s.casecmp("yes").zero?
end
end
end
Expand Down Expand Up @@ -232,6 +245,10 @@ def parse(args)
print "Discard the content column in the results? (yes/no): "
options.lite = $stdin.gets.chomp.casecmp("yes").zero?
end
if options.discard_salary.nil?
print "Discard the salary column in the results? (yes/no): "
options.discard_salary = $stdin.gets.chomp.casecmp("yes").zero?
end

if options.categories.nil?
print "Do you want to select job categories? (yes/no): "
Expand Down Expand Up @@ -354,7 +371,10 @@ def extract_keys_and_values(output_obj)
end
page = agent.get("#{site}/jobs", params)
results = [
["Title", "URL", "Advertiser", "Location", "Listing Date", "Salary", "Classification", "Sub Classification", "Short Description"] + (options.lite ? [] : ["Content"])
["Title", "URL", "Advertiser", "Location", "Listing Date"] +
(options.discard_salary ? [] : ["Salary"]) +
["Classification", "Sub Classification", "Short Description"] +
(options.lite ? [] : ["Content"])
]

if options.print_total
Expand Down Expand Up @@ -400,8 +420,10 @@ def extract_keys_and_values(output_obj)
url,
advertiser,
location,
listing_date,
salary,
listing_date
]
resultsrow << salary unless options.discard_salary
resultsrow += [
classification,
sub_classification,
# work_type,
Expand Down

0 comments on commit f7b26b3

Please sign in to comment.