Skip to content

Commit

Permalink
fix: #37, update selector for finding tracking number
Browse files Browse the repository at this point in the history
  • Loading branch information
egg- committed Apr 15, 2024
1 parent 6edab4b commit 94d535c
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 94 deletions.
8 changes: 6 additions & 2 deletions lib/courier/usps.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var parser = {
}
var result = {
courier: courier,
number: $('input[name=label]').val().trim(),
number: $('span.tracking-number').text().trim(),
status: tracker.STATUS.PENDING
}

Expand All @@ -44,7 +44,11 @@ var parser = {
status: tracker.STATUS.IN_TRANSIT,
// November 17, 2017, 3:08 pm
time: moment(
$(element).find('.tb-date').text().trim(),
$(element)
.find('.tb-date')
.text()
.trim()
.replace(/[\t|\n]/g, ''),
'MMMM DD, YYYY, hh:mm a'
).format('YYYY-MM-DDTHH:mm')
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "delivery-tracker",
"version": "2.8.0",
"version": "2.8.1",
"author": {
"name": "egg",
"email": "[email protected]"
Expand Down
383 changes: 292 additions & 91 deletions test/fixtures/usps-DELIVEREDNM

Large diffs are not rendered by default.

0 comments on commit 94d535c

Please sign in to comment.