#wreq
Explore tagged Tumblr posts
Text
Is it time for me to actually contribute to hackage?
I have been messing with effectful and it is pretty nice, but I would like to have wreq as an effect, and optimally warp and twain as well
I have never actually maintained a library, might be fun tbh.
0 notes
Photo
this took 7 minutes and i’ve called the cops on myself
#4 harrowing minutes spent looking for a matty picture#between this and shallow i am a wreq#the 10 commandments#lmao#icbmil
35 notes
·
View notes
Text
utlana is writing stuff
I'm taking request!!
I mostly write dsmp, but if it falls under the category of anything I reblog, I'll definitely consider it :)
I DON'T write:
y/n or graphic violence
Here's my AO3 btw (I don't really cross post but I might in the future):
0 notes
Note
I know the Kamie boat was sunk on the show, but with Vanjie as Poison Ivy and Kam dressed as a clown for the Halloween Wreq The World, can we please have a Poison Ivy/Harley Kamjie fic? Pretty please?
.
1 note
·
View note
Text
Giving a face to neglected books: Retrieving book artwork from the net with Haskell
Books nowadays get beautiful covers that are perfect for recognizing them in the blink of an eye. Just look at the below example, which books can you find more easily?
The blue icons could be any book. The books with a thumbnail, however, are easily recognizable. In this article, therefore, we will see how to programmatically search Google Scholar for artwork. Downloading the image and inserting it in the ebook would be a next step.
The plan
So how would we achieve this? First we find identifying information about the book in its metadata, as explained previously in another blog post. Then we question Google Books what they know about this book. We analyze their response to search for the id they use. We can later use this ID to download the cover. Schematically, this becomes:
Search book for identifying info (explained here)
Google the information
Search their response for the book’s id
Download picture (not explained in this blog)
Imagine that we are trying to search the cover of De schaapherder, the above mentioned book. If we follow the above plan, it goes like this:
We take “de schaapherder” and “oltmans” (the second book from the right in the picture);
We use google’s api to google it. We can do this by appending the above words to the url https://www.googleapis.com/books/v1/volumes?q=
From the json response we take the volume ID;
We use that ID to download the related picture by appending that ID to this url: https://books.google.com/books/content?printsec=frontcover&img=1&zoom=2&source=gbs_api&id=
Supporting code
Now we’re almost getting to the real meat of the job. First we need to install some libraries to ease our work, namely wreq and aeson. The first will allows us to do http requests with a simple get command (that is, read internet pages). Aeson is a json parser needed to understand Google. Install them like you normally do, through cabal or stack.
We also need some standard library stuff like Data.Text and .Vector.
Add the following lines to the top of your file:
import Network.Wreq import Data.Aeson.Lens import Data.Text import qualified Data.Vector as V
The code
We’re finally here, the actual code! Converting the above steps 2 and 3 into Haskell code, we get:
-- Google’s url googleBooksUrl = "https://www.googleapis.com/books/v1/volumes?q=" -- Search Google for a book googleVolumeId :: Text -> IO (Maybe Text) googleVolumeId keywords = do responseJson <- googleABook keywords let items = responseJson ^. responseBody ^. key "items" . _Array let maybeId = (items V.! 0) ^? key "id" . _String return maybeId -- The actual HTTP request; it also replaces spaces with + to make a correct url googleABook keywords = do let url = (++) googleBooksUrl $ unpack $ replace " " "+" keywords get url
The function googleBooksUrl is only there as a constant for the url we need to consult. The last function, googleABook, is the actual HTTP request.
The function googleVolumeId weaves it all together. It commands the search, parses the json in the response, and returns an ID if it finds one.
Now for the technical explanation! Specifically, the strange operator ^. tell the next function to look into the result of previous. So responseJson is Google’s response to our query. ResponeBody takes the body, then key “items” looks in there for a json key-value pair named “items”. The key’s corresponding value is converted to an array by _Array and assigned to items.
Next it’s necessary to only access the first item of that array with index number 0 and search in there again for a key-value pair, but named “id” this time. That value is converted to a string (a text value) by _String.
But because we’re not sure whether this step will succeed, we use the ^? operator. This makes sure that if the array is empty, trying to access it will not crash the program. It’s also what causes us to return a Maybe value instead of a normal value.
Warnings
Be warned that for brevity the above code doesn’t anticipate errors. Using it as-is, unmodified might crash your program. Secondly, while Google doesn’t seem to mind consulting their api for low traffic purposes, for high traffic you might need to register and get a special key with them.
Continuing
So now you have the Google Books ID, what next? You can append it to the earlier mentioned url in step 4 to actually download the image. To give you a hint, you can again use Wreq to perform the download. Then you only to write it result out to a file. Good luck!
0 notes
Photo
Ligue 1 : la « saison blanche » est exclue en cas d'arrêt (L'Équipe : https://olplus.fr/-wrEq)
1 note
·
View note
Text
‘What I Did Saved My Life’: Arkansas Man Defends Decision to Not Comply With Officer’s Demands Out of Fear of Getting Shot
‘What I Did Saved My Life’: Arkansas Man Defends Decision to Not Comply With Officer’s Demands Out of Fear of Getting Shot
An Arkansas man has been arrested after failing to comply with a local police officer, but he says he did so because he was afraid for his life.
The incident occurred in Helena-West Helena, Arkansas, at a closed Double Quick convenience store. Ed Truitt met family there to head back home to Jonesboro, Arkansas, this past weekend. He told WREQ he was parked at the store just after 3 a.m. Sunday,…
View On WordPress
0 notes
Text
Arcade headcanons 2
Final boss takes pleasure in going after turn-based game characters and regularly kills them due to their inability to deal with his non-turn based combat. This means he takes his time with their worlds, and means that they are in turn more likely to add to the roster of his opponents.
Hes given each of the battle bosses their original game world as their stage, and as they subjugate and wreq other worlds he rewards them with the “minions” or power ups of those worlds.
So far only battleboss Blitzcrank and Ziggs were former game protagonists, but Veigar is always looking for heroes who he can corrupt or who would side with him willingly.
Veigar cheats. From in-game codes, to exploits, and even blatant changing the code of the games he’s in, the Final Boss will never accept defeat...for long. (Sona cheated too, which surprised him long enough for him to need to reload the save and avoid their fight entirely for now)
0 notes
Photo
TRAIN WREQ 💦 @eransom @an2dote Greek Paraphernalia STORE Call us @ 912-201-1246 stop in open 9 A.M to 7 P.M WEBSITE Always open 24 7 365 [👉 www.1lineup.com 👈] #ΑΦΑ #ΑΚΑ #ΚΑΨ #ΩΨΦ #ΔΣΘ #ΦΒΣ #ΖΦΒ #ΣΓΡ #ΙΦΘ #KΛX #ALPHAKAPPAALPHA #DELTASIGMATHETA #SIGMAGAMMARHO #ZETAPHIBETA#IOTAPHITHETA #OMEGAPSIPHI #PHIBETASIGMA #KAPPAALPHAPSI #SSU #JCSU #SCSU #KappaLambdaChi #ALPHAPHIALPHA #onlinestore #lineupembroidery #probateseason #greeklinejackets #probates #OES#ORDEROFTHEEASTERNSTAR (at Lineup)
#phibetasigma#σγρ#ζφβ#probateseason#omegapsiphi#zetaphibeta#αφα#greeklinejackets#orderoftheeasternstar#καψ#lineupembroidery#ssu#kappalambdachi#oes#δσθ#scsu#ωψφ#ιφθ#onlinestore#deltasigmatheta#ακα#φβς#kappaalphapsi#alphakappaalpha#iotaphitheta#alphaphialpha#kλx#probates#sigmagammarho#jcsu
0 notes
Text
I’m so sad, like, I need to buy a new phone bc mine got wet washing the fucking car, I want to buy tickets for Beyond Wonderland, Wish outdoor, wreq the world (bc of Bianca, Shangela and Detox), Sissy that show(bc of Bebe, Sharon, Raja, Tyra and Trinity) and Alaska is coming, like
0 notes