Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - joejoe

#31
Thanks to both Ralph and Hans-Peter!



I am trying Ralph's and am getting nil response.



If I am understanding correctly, Ralph intended that I do something like this:


(set 'ali (get-url ali-link))
(set 'alie (json-parse ali))

(set 'jsondata (lookup "products" (lookup "result" alie)))
 
(define (raisins jsonitem)
    (format "<a href="%s">%s</a>n"<img src="%s">nn"
          (string (if (ref '("productUrl" ?) jsonitem match true) ($it 1)))
          (string (if (ref '("imageTitle" ?) jsonitem match true) ($it 1)))
          (string (if (ref '("imageUrl" ?) jsonitem match true) ($it 1))) ))
         
(println (map raisins (if (ref '("products" ?) jsondata match true) ($it 1) '())))


When I run this in my browser, I get this result:


()

When I do


(println (set 'jsondata (lookup "products" (lookup "result" alie))))

to see what I am working with, I get this:


((("productTitle" "...

Notice the three leading parenthesis.



When I do this:


(println (set 'jsonitem (jsondata 0)))

I get this:


(("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo T-shirt Top Lycra Cotton Men T shirt New Design High Quality") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1Q2qyOVXXXXa8aFXXq6xXFXXX2/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-T-shirt-Top.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-short-sleeved-T-shirt-men/2048564231.html"))

It seems the extra set of parenthesis that comes with jsondata are making it so the define cannot only get into the first set, which doesn't have the product data sets? I've tried a bunch of tweaks and am coming back to ask if I might be missing something simple.



Thank you both and all again! :0)
#32
Hi,



I would like to format json data into html.



I have attempted this for a few days, and success looms. :0)



The json-parse return data is this:



(("result" (("totalResults" 19) ("products" ((("productTitle" "GILDAN EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1HMtjKuuSBuNjSsziq6zq8pXaz/GILDAN-EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt.jpg") ("productUrl" "https://www.aliexpress.com/item/GILDAN-EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt/32919995838.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt men") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1ZiW5OVXXXXbhXFXXq6xXFXXX5/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt-men.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt-men/2048199251.html")) (("productTitle" "GILDAN EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1gNryaifrK1RjSspbq6A4pFXa6/GILDAN-EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt.jpg") ("productUrl" "https://www.aliexpress.com/item/GILDAN-EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt/32961316694.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest short-sleeved T-shirt men") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1OQTXX9CWBuNjy0Fhq6z6EVXa1/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt-men.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-short-sleeved-T-shirt-men/32708902913.html")) (("productTitle" "Lisp John McCarthy Lisp t shirt top clothing tee for funny male tshirt harajuku streetwear t-shirt men hip hop C2613") ("imageUrl" "https://ae01.alicdn.com/kf/HLB1KsivXOHrK1Rjy0Flq6AsaFXa8/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-t-shirt-top.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-t-shirt-top-clothing-tee-for-funny-male-tshirt-harajuku-streetwear-t/32951457641.html")) (("productTitle" "Lisp John McCarthy Lisp t shirt men hop t-shirt clothing tshirt male streetwear harajuku funny top hip for tee PF2613") ("imageUrl" "https://ae01.alicdn.com/kf/HLB1fw3tKHvpK1RjSZFqq6AXUVXaG/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-t-shirt-men.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-t-shirt-men-hop-t-shirt-clothing-tshirt-male-streetwear-harajuku-funny/32983702961.html")) (("productTitle" "New Short Sleeve Round Collar Mens T Shirts Fashion 2018 A Lisp Symbol - Mens Crewneck T-shirt - 7 Colours") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1KMFuXiCYBuNkSnaVq6AMsVXam/New-Short-Sleeve-Round-Collar-Mens-T-Shirts-Fashion-2018-A-font-b-Lisp-b-font.jpg") ("productUrl" "https://www.aliexpress.com/item/New-Short-Sleeve-Round-Collar-Mens-T-Shirts-Fashion-2018-A-Lisp-Symbol-Mens-Crewneck-T/32851305347.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo T-shirt Top Lycra Cotton Men T shirt New Design High Quality") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1Q2qyOVXXXXa8aFXXq6xXFXXX2/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-T-shirt-Top.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-short-sleeved-T-shirt-men/2048564231.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo T-shirt Top Lycra Cotton Men T shirt New Design High Quality") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1lv2iX1OSBuNjy0Fdq6zDnVXaz/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-T-shirt-Top.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-T-shirt-Top-Lycra-Cotton-Men-T/32708922788.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1ooXHbzuhSKJjSspjq6Ai8VXa9/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton/32834143521.html")) (("productTitle" "EMACS GNU XEMACS LISP programmers wildebeest men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1UabedvBNTKJjSszbq6yFrFXaf/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmers-wildebeest-men-Sweatshirts-Thick-Combed-Cotton/32833672611.html")) (("productTitle" "Lisp John McCarthy Lisp t shirt harajuku kawaii t-shirt female femme cartoon tops tshirt women tee clothing graphic K2613") ("imageUrl" "https://ae01.alicdn.com/kf/HTB17jx4e9rqK1RjSZK9q6xyypXaE/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-t-shirt-harajuku.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-t-shirt-harajuku-kawaii-t-shirt-female-femme-cartoon-tops-tshirt-women/32934917454.html")) (("productTitle" "Lisp John McCarthy Lisp Hoodies Men Casual Hip Hop Sweatshirt Traksuit Pullover Hoody Tops E4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1sxcOKXGWBuNjy0Fbq6z4sXXah/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-Hoodies-Men-Casual.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-Hoodies-Men-Casual-Hip-Hop-Sweatshirt-Traksuit-Pullover-Hoody-Tops-E4301/32922051065.html")) (("productTitle" "Lisp John McCarthy Lisp Hoodies Men Hooded Sweatshirts Print Quality Pullover Casual Fashion Tracksuit Streetwear X4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1bTA7IHGYBuNjy0Foq6AiBFXai/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-Hoodies-Men-Hooded.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-Hoodies-Men-Hooded-Sweatshirts-Print-Quality-Pullover-Casual-Fashion-Tracksuit-Streetwear-X4301/32905489790.html")) (("productTitle" "Lisp John McCarthy Lisp Hoodies Men Hooded Sweatshirts Print Quality Pullover Casual Fashion Tracksuit Streetwear X4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1M5cvmTmWBKNjSZFBq6xxUFXa9/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-Hoodies-Men-Hooded.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-Hoodies-Men-Hooded-Sweatshirts-Print-Quality-Pullover-Casual-Fashion-Tracksuit-Streetwear-X4301/32910155757.html")) (("productTitle" "Lisp John McCarthy Lisp 3D Hoodie Hoodies Men Women 2019 Long Sleeve Autumn WInter Tops Tees Casual Sweatshirt Sweatshirts P4301") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1ENJeXELrK1Rjy0Fjq6zYXFXaH/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-3D-Hoodie-Hoodies.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-3D-Hoodie-Hoodies-Men-Women-2019-Long-Sleeve-Autumn-WInter-Tops-Tees/32946570658.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1X.5ampcJL1JjSZFOq6AWlXXao/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-men-Sweatshirts-Thick.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-men-Sweatshirts-Thick-Combed-Cotton/32834402567.html")) (("productTitle" "EMACS GNU XEMACS LISP programmer red and blue logo men Sweatshirts Thick Combed Cotton") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1V9WKXLNNTKJjSspfq6zXIFXa6/EMACS-GNU-XEMACS-font-b-LISP-b-font-programmer-red-and-blue-logo-men-Sweatshirts-Thick.jpg") ("productUrl" "https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-men-Sweatshirts-Thick-Combed-Cotton/32833411013.html")) (("productTitle" "Lisp John McCarthy Lisp 3D Print Hoodies women 2018 Black Cosplay Hoody Sweatshirt kpop Hipster Streetwear Tops Pullovers V2613") ("imageUrl" "https://ae01.alicdn.com/kf/HTB1Y_HUXjDuK1Rjy1zjq6zraFXay/-font-b-Lisp-b-font-John-McCarthy-font-b-Lisp-b-font-3D-Print-Hoodies.jpg") ("productUrl" "https://www.aliexpress.com/item/Lisp-John-McCarthy-Lisp-3D-Print-Hoodies-women-2018-Black-Cosplay-Hoody-Sweatshirt-kpop-Hipster-Streetwear/32935074154.html")))))) ("currentPageNum" 0) ("errorCode" 20010000) ("totalPageNum" 0))


I would like to translate this to html to display this:


<a href="https://www.aliexpress.com/item/EMACS-GNU-XEMACS-LISP-programmer-red-and-blue-logo-men-Sweatshirts-Thick-Combed-Cotton/32833411013.html">EMACS GNU XEMACS LISP programmer red and blue logo men Sweatshirts Thick Combed Cotton</a>
<img src=https://ae01.alicdn.com/kf/HTB1HMtjKuuSBuNjSsziq6zq8pXaz/GILDAN-EMACS-GNU-XEMACS-font-b-LISP-b-font-programmers-wildebeest-short-sleeved-T-shirt.jpg">"


Essentially, grabbing the item information from json and transposing it to display html.



I am trying with lookup and dolist but am having trouble getting into the parentheses without having to create a lookup address for each item.



I can get this far:


(set 'ali (get-url ali-link))
(set 'alie (json-parse ali))
(println (lookup "products" (lookup "result" alie)))


Thank you greatly for any quick pointer or general direction! :9)
#33
newLISP newS / Re: Book about Fuzzy Logic in newLISP
March 13, 2019, 08:42:17 PM
Argüelles,



Thank you for the meta extension facility! Looks stellar!



Quick question, do you have a license associated w the code?



nL is GPL which allows us to modify contribute it without letting others close source it.



I'm getting a grasp of the idea of fuzzy logic on top of nL! Kudos! :D
#34
Quote from: "ralph.ronnquist"You might have meant the third line be
(set 'worder (map lower-case words))

Ralph, you always bat cleanup around here. Thank you!



It's hard to admit you know what I want to do before I even thought to do it! ;0)



Thanks for this very much and learned going forward. Big thanks for this and all many past!
#35
Hi and thanks!


(set 'word (join titles " "))
(set 'words (find-all {w{5,}} word))
(set 'worder (lower-case (string words)))
(println (sort worder))

ERR: list or array expected in function sort : worder

worder looks similar to this: ("one" "two" "three")



How would I best sort this?



Thanks very much for help!
#36
Thanks again Ted,! I was able to do it with get-url here.


(json-parse (get-url "https://pastebin.com/raw/brx7F2vA"))


(("ID" ("1" "2" "3" "4" "5" "6" "7" "8")) ("Name" ("Rick" "Dan" "Michelle" "Ryan"            
   "Gary" "Nina" "Simon" "Guru"))                                                            
 ("Salary" ("623.3" "515.2" "611" "729" "843.25" "578" "632.8" "722.5"))                      
 ("StartDate" ("1/1/2012" "9/23/2013" "11/15/2014" "5/11/2014" "3/27/2015" "5/21/2013"        
   "7/30/2013" "6/17/2014"))
 ("Dept" ("IT" "Operations" "IT" "HR" "Finance" "IT" "Operations" "Finance")))
#37
Hi,



(json-parse (exec "curl https://www.asdf.com/asdf.json">https://www.asdf.com/asdf.json"))



I am getting the message that a string is expected.



The result of the exec has [text]......[/text] at the beginning and end of what is returned.



Is this why json-parse thinks it is not a string?



I tried (json-parse (string (exec "curl....))) too. Still says a string is expected.



How do I remove the [text] ... [/text] so that the result can be interpreted by (json-parse)?



Thanks!
#38
Anything else we might add? / Re: Newlisp vs Lua
February 02, 2018, 06:14:20 PM
TedWalther,



I have long appreciated your advice and direction.



On multiple occasions you have guided me in the proper direction.



Thank you. Your responses I regard as true mentorship. That is absolute.


QuoteYou need to look at it from both sides. [...]

The choice I have is, [...] [contribute to closed or open ecosystems].

Yes, the GPL requires that the end user (our own selves included) rank higher than a developer/distributor's personal interests. I would agree and still hold that my spent 'life force' is greater when more people can make more use of it than I can myself alone.


QuoteGPL takes that choice away from me.

As it is designed to. Greater good outranks personal profit, any way we dice it.



It does so to insure the allowance to end users, a larger benefit to our society.



Multiplication stacks way higher than does simple addition. It's your choice always.


QuoteAs for my grandkids, if you think BSD license will prevent them from accessing my source code, you are wrong.

If I grab your BSD code and redistribute it closed, I'd say your code would not be available to your grandkids.



Grandpa, what's my computer doing? 'I used to know'.


QuoteEven the GNU C compiler allows you to [...]

Survivability still often supercedes even the greatest of ethic.



I'm not in. Wouldn't want anyone not to know what their computer is doing.
#39
Anything else we might add? / Re: Newlisp vs Lua
February 02, 2018, 12:39:28 AM
newLisp vs Lua.



These are two differently licensed projects, which make them incomparable.


Quote from: "rickyboy"
I always try to be mindful of what the licensing is for the tools that I use, and I consider MIT/BSD/ISC and the like to be superior (namely, more free) than any GPL.


If you contributed code that your grand-kids could not make use of because your license choice allowed the boxing up and redistribution of your source code without sharing the source code to your grand-kids, that would be a loss, like not really free code (i.e., MIT/BSD).



Dual-licensing allows for deception and deprivation, a novice move. Freedom does not tend towards denying others a freedom you were freely given.



The authors of GPL software want to make sure that any contribution to their codebase remains "free". Free, like code that is not able to be boxed up as unreadable, unredistributable, unusable software.



Everyone here understands how their (copyleft) contributions remain available to everyone else because the GPL requires any redistribution of their code to include the source code, important when you want to know what your computer is doing.



Here's a better explanation than I can offer. Well worth the reading!



https://www.gnu.org/licenses/copyleft.en.html">https://www.gnu.org/licenses/copyleft.en.html



"Copyleft says that anyone who redistributes the software, with or without changes, must pass along the freedom to further copy and change it. Copyleft guarantees that every user has freedom."



Lua is MIT/BSD, newLisp is GPL. These are two different permissions.



If you want your contributions able to be denied to another, go with Lua (MIT licensed software).



If you want to make sure you contributions are available and impermeably free, go w newLisp (copyleft).



MIT/BSD projects do not last over time because too many contributions are absconded with.



License consideration allows for software utility, part of what makes nL better than anything out there!
#40
newLISP in the real world / Re: generating aws signature
December 21, 2016, 01:47:00 PM
Ok gotcha thanks.



I got the signatures generating correctly with your message help, Ralph.


(string (chop (base64-enc (crypto:hmac ....)) "%3D")

This did it and a few tweaks to finalize the url formatting got successful api calls.



Thanks all for the help!
#41
newLISP in the real world / Re: generating aws signature
December 21, 2016, 07:32:33 AM
I think the issue may be with line breaks.



When I do this:


(set 'output1 (crypto:hmac crypto:sha256 "onetwo" "1234567890"))

(set 'signature-hex (unpack (dup "b" (length output1)) output1))

(println (join (map (curry format "%02x") signature-hex)))


I get this:


47d07edd67e5cca3bb98c5cf4cca73459dd8a89afaa555ac7b4ce475c6ae6c27

The online HMAC generator tester confirms the same:


47d07edd67e5cca3bb98c5cf4cca73459dd8a89afaa555ac7b4ce475c6ae6c27

However, when I try to put a line break in the string with:


(set 'output1 (crypto:hmac crypto:sha256 "one
two" "1234567890"))


I get this:


b599058300d5ed4e5f160c30745c74f3e6c5cfc6683cc9d36b9a279f8955077e

However, the online HMAC tool shows this:


e16a940481b8b9dd18211f5fb637bd5d926ac9d6e446e6489f030d66ea17fb91

And in the online HMAC tool I am inputting in the string so it has the line break:


one
two


Getting close!!



Would there be any clues out there?



Thank you!!!
#42
newLISP in the real world / Re: generating aws signature
December 14, 2016, 06:26:30 PM
Hi and thanks,



I want to back up to make sure I have the HMAC SHA256 signature calculating correctly.



I am trying this:


(set 'output1 (crypto:hmac crypto:sha256 (string "GET
webservices.amazon.co.uk
/onca/xml
AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Actor=Johnny%20Depp&AssociateTag=mytag-20&Operation=ItemSearch&Operation=ItemSearch&ResponseGroup=ItemAttributes%2COffers%2CImages%2CReviews%2CVariations&SearchIndex=DVD&Service=AWSECommerceService&Sort=salesrank&Timestamp=2016-12-15T01%3A42%3A01.000Z&Version=2013-08-01") "1234567890"))

(set 'signature-hex (unpack (dup "b" (length output1)) output1))
(println (join (map (curry format "%02x") signature-hex)))


I get this:


786c6ac1346d09aeb7fc4d158e70201141ee483d9e338958bf8492740969a997

On the AWS tester tool[1], it says the HMAC signature should be this:


eGxqwTRtCa63%2FE0VjnAgEUHuSD2eM4lYv4SSdAlpqZc%3D

With an online HMAC generator tester tool[2] set to SHA256, it says I should get this signature:


9f4defac2a33e7ce3e585c0515bdba65d272fd8852a3b40e5549f8ad9104c4ac

Anyone know which is correct? Thanks! :D



[1] https://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html">https://associates-amazon.s3.amazonaws. ... index.html">https://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html

[2] https://www.freeformatter.com/hmac-generator.html#ad-output">https://www.freeformatter.com/hmac-gene ... #ad-output">https://www.freeformatter.com/hmac-generator.html#ad-output
#43
newLISP in the real world / Re: generating aws signature
December 11, 2016, 02:57:07 AM
Hi and thank you for help,



Here is what I am running:


#!/usr/bin/newlisp

(module "crypto.lsp")

(set 'pubkey "aa")
(set 'privkey "bb")

(set 'timestamp (string (date (date-value) 320 "%Y") "-" (date (date-value) 320 "%m") "-" (date (date-value) 320 "%d") "T" (date (date-value) 320 "%H") "%3A" (date (date-value) 0 "%M") "%3A" (date (date-value) 320 "%S") "Z"))

(println timestamp)

(set 'output1 (crypto:hmac crypto:sha256 "GET
ecs.amazonaws.com
/onca/xml
AWSAccessKeyId=" (silent pubkey) "&Keywords=newlisp&Operation=ItemSearch&SearchIndex=Books&Service=AWSECommerceService&Timestamp=" (silent timestamp) "&Version=2011-08-01" (silent privkey)))

(set 'output2 (unpack (dup "b" (length output1)) output1))

(set 'output3 (crypto:hmac crypto:sha256 "GET
ecs.amazonaws.com
/onca/xml
AWSAccessKeyId=" (silent pubkey) "&Keywords= newlisp&Operation=ItemSearch&SearchIndex=Books&Service=AWSECommerceService&Timestamp=" (silent timestamp) "&Version=2011-08-01" (string output2)))

(set 'signature-hex (unpack (dup "b" (length output3)) output3))

(println (join (map (curry format "%02x") signature-hex)))

(exit)


I get a new timestamp but the signature doesn't change when I re-execute it.



Thanks for any tip!
#44
newLISP in the real world / Re: generating aws signature
November 05, 2016, 04:03:54 AM
Hi and thanks!



I think I got to the signature:



("131 37 166 173 32 246 42 23 198 156 244 102 148 91 171 80 252 115 124 141 246 64
 19 94 85 112 145 181 2 189 98 73")

When I use an online hex decoder I get this: qf3"FB#V$A‰q€%!AA$fA™HQQ!‰˜s



Looks like a signature!



How would I decode the hex in nL to produce this signature?



I have tried different things with char and format but am still swinging at it.



Thank you very much for the help! :D



If I helps anyone, here is how I have gotten this far:


#!/usr/bin/newlisp

(module "crypto.lsp")

(set 'output1 (crypto:hmac crypto:sha256 "GET
ecs.amazonaws.com
/onca/xml
AWSAccessKeyId= AAAAAAAAAAAAAAAAAAA&AssociateTag=PutYourAssociateTagHere&Keywords=newlisp&Operation=ItemSearch&SearchIndex=Books&Service=AWSECommerceService&Timestamp=2016-11-05T10%3A25%3A14.000Z&Version=2011-08-01" "BBBBBBBBBBBBBBBBBBBBBBBBBBBBB"))

(set 'output2 (unpack (dup "b" (length output1)) output1))

(set 'output3 (crypto:hmac crypto:sha256 "GET
ecs.amazonaws.com
/onca/xml
AWSAccessKeyId= AAAAAAAAAAAAAAAAAAA&AssociateTag=PutYourAssociateTagHere&Keywords= newlisp&Operation=ItemSearch&SearchIndex=Books&Service=AWSECommerceService&Timestamp=2016-11-05T10%3A25%3A14.000Z&Version=2011-08-01" (string output2)))

(set 'signature-hex (unpack (dup "b" (length output3)) output3))

(println signature-hex)

(exit)
#45
Got it, thanks Ralph! Much appreciated!! :D