needs net/http
var ids
[] var, tasks
\ Locker words. Locked variable is embedded into word, so wastes no dictionary space on captive locker variable.
"" dup
: lock-write literal lock drop ;
: unlock-write literal unlock drop ;
: STORIES_URL "https://hacker-news.firebaseio.com/v0/topstories.json" ;
: ITEM_URL_BASE "https://hacker-news.firebaseio.com/v0/item/" ;
: get-ids
STORIES_URL net:get if
nip json>
' >s a:map ids !
else
"Error retrieving data." throw
then ;
: task \ ids-slice --
( nip ITEM_URL_BASE "%s%s.json" s:strfmt net:get if
nip json>
"title" m:@ nip
lock-write . cr unlock-write
else
"Error retrieving data." throw
then
) a:each drop ;
: start-tasks
tasks @
( ids @ swap -1 8 a:slice+ 1 ' task t:task-n a:push ) 0 7 loop
drop ;
: wait-tasks
tasks @ t:wait ;
: app:main
get-ids
start-tasks
wait-tasks
bye ;
Invoice:
AllowIPNPayment: false
AllowOnlinePayment: false
AllowOnlineCreditCardPayment: false
AllowOnlineACHPayment: false
InvoiceLink: https://developer.intuit.com/comingSoonview/scs-v1-6330de5b6ed04fc7af182508019d19da02ecbae268eb4711bc3dd263db257d380e094b948c3f4250b5a8082dd9c333d3?locale=en_US&cta=v3invoicelink
domain: QBO
sparse: false
Id: 130
SyncToken: 0
MetaData:
CreateTime: 2022-06-15T13:16:17-07:00
LastModifiedByRef:
value: 9130354319489646
LastUpdatedTime: 2022-06-15T13:16:17-07:00
CustomField:
0:
DefinitionId: 1
Name: Crew #
Type: StringType
StringValue: 102
DocNumber: 1037
TxnDate: 2022-06-15
CurrencyRef:
value: USD
name: United States Dollar
LinkedTxn:
0:
TxnId: 100
TxnType: Estimate
Line:
0:
Id: 1
LineNum: 1
Description: Rock Fountain
Amount: 275
LinkedTxn:
0:
TxnId: 100
TxnType: Estimate
DetailType: SalesItemLineDetail
SalesItemLineDetail:
ItemRef:
value: 5
name: Design:Fountains:Rock Fountain
UnitPrice: 275
Qty: 1
ItemAccountRef:
value: 79
name: Sales of Product Income
TaxCodeRef:
value: TAX
1:
Id: 2
LineNum: 2
Description: Fountain Pump
Amount: 12.75
LinkedTxn:
0:
TxnId: 100
TxnType: Estimate
DetailType: SalesItemLineDetail
SalesItemLineDetail:
ItemRef:
value: 11
name: Design:Fountains:Pump
UnitPrice: 12.75
Qty: 1
ItemAccountRef:
value: 79
name: Sales of Product Income
TaxCodeRef:
value: TAX
2:
Id: 3
LineNum: 3
Description: Concrete for fountain installation
Amount: 47.5
LinkedTxn:
0:
TxnId: 100
TxnType: Estimate
DetailType: SalesItemLineDetail
SalesItemLineDetail:
ItemRef:
value: 3
name: Design:Fountains:Concrete
UnitPrice: 9.5
Qty: 5
ItemAccountRef:
value: 48
name: Landscaping Services:Job Materials:Fountains and Garden Lighting
TaxCodeRef:
value: TAX
3:
Amount: 335.25
DetailType: SubTotalLineDetail
SubTotalLineDetail:
TxnTaxDetail:
TxnTaxCodeRef:
value: 2
TotalTax: 26.82
TaxLine:
0:
Amount: 26.82
DetailType: TaxLineDetail
TaxLineDetail:
TaxRateRef:
value: 3
PercentBased: true
TaxPercent: 8
NetAmountTaxable: 335.25
CustomerRef:
value: 24
name: Sonnenschein Family Store
CustomerMemo:
value: Thank you for your business and have a great day!
BillAddr:
Id: 95
Line1: Russ Sonnenschein
Line2: Sonnenschein Family Store
Line3: 5647 Cypress Hill Ave.
Line4: Middlefield, CA 94303
Lat: 37.4238562
Long: -122.1141681
ShipAddr:
Id: 25
Line1: 5647 Cypress Hill Ave.
City: Middlefield
CountrySubDivisionCode: CA
PostalCode: 94303
Lat: 37.4238562
Long: -122.1141681
FreeFormAddress: true
SalesTermRef:
value: 3
name: Net 30
DueDate: 2022-07-15
TotalAmt: 362.07
ApplyTaxAfterDiscount: false
PrintStatus: NeedToPrint
EmailStatus: NotSet
BillEmail:
Address: Familiystore@intuit.com
Balance: 362.07
time:
0: 2022-08-06T13:48:19.168-07:00