Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [curl]

cURL is a library and command-line tool for transferring data using several protocols such as HTTP, FTP and Telnet.

-1
votes
0answers
17 views

Generating PHP code for web requests

I have a program that generates PHP code for web requests using a template and its output is like the code below. I was trying to make it a function that could be easily pasted and called in every ...
4
votes
1answer
47 views

Upload a directory, in parallel, to an artifact repository

This code uploads an entire directory and allows for its reparenting on a remote server (an artifact repository). Three concerns: Copying the files locally takes a lot of space. Ideally, I could use ...
1
vote
1answer
36 views

Retrying Curl X amounts of Time until Successful Return (Script/Functions)

I'm under no illusion that this is at all the best way or even a good way of doing this. It's simply a working solution. Tips, opinions, suggestions, insults, death threats, let's hear it. ...
3
votes
0answers
40 views

Perl PasteBin scraper

I'd like to optimize my code and get a better of understanding of how I can perform the task I am doing better. I've only used Perl threads about 3 or 4 times now. The purpose of my script / code ...
0
votes
0answers
131 views

Check PHP cURL script should work as required

I recently messed up and uninstalled some dependencies for a server that are a pig to get back. I think it's going to be easier and quicker to replace the package with cURL instead. Could someone ...
1
vote
0answers
39 views

Getting a filename from Mediafire

In short, how do I improve my code? I have a couple of files on Mediafire.com, link to shared folder for the purpose of this question. I would like to get a list of download-links and filenames so I ...
0
votes
1answer
76 views

Displaying an order status form

Below is code i used to call Api and display the "Status" results in web page. my senior told me that code is completely mess and need to improve so that it should be easy to understand for others. ...
3
votes
1answer
993 views

Laravel voting system

I have written a voting class in Laravel. It uses the voting sites API to check if the user has voted today. A user is only allowed to vote once every day. All votes reset at midnight (i.e. 12:00 AM ...
3
votes
1answer
712 views

Optimize cURL requests to Google API

I have a table in MySQL with approx. 20 million rows and the following columns: id | word_eng | word_indic I have to translate the English word (the value in ...
0
votes
1answer
146 views

Wrapper class for calling external API [closed]

I have a PHP cronjob script. I need to send requests and get responses from some external API. So, there is code for the API class. In this class, I connect to the API and call public methods of ...
2
votes
2answers
286 views

cURL grabber, gets info from imdb & allmusic

I've put together a class that grabs data from imdb.com or allmusic.com, then inserts the data into a database, copy's the poster, also updates the data if ...
7
votes
3answers
2k views

Getting the current IP from the command line

I made a tiny little bash script, that prints the current IP Address to the command line. I checked the script with ShellCheck (0.4.6-1) on a local debian install and I get the following message: ...
1
vote
0answers
66 views

Fetch value from website using cURL

I want to make a http request, get the website content and check one specific element. Currently I'm doing it with lcurl (got explanations from a tutorial). Here is an excerpt of my code: ...
4
votes
0answers
106 views

Curl-based REST Client Library (round 3)

This code review request relates to this code review which covers the basic single REST call use case in this this REST client library. This code review covers the classes and unit tests for the ...
2
votes
0answers
78 views

Curl-based REST client library (round 2)

This is a second iteration on an earlier review - cURL based REST client library I have done some refactoring to split out the REST HTTP response into it's own class from what was in the previous ...
3
votes
2answers
580 views

cURL based REST client library

I have recently refactored a REST client library and was hoping to get review for both the class itself and the unit tests that cover it. This code is developed against PHP 7.1, but tested against ...
3
votes
0answers
711 views

Convert a curl command into Ruby

I had a curl command which I converted using this. This is the Ruby script: ...
3
votes
0answers
444 views

Ruby script to to check the status of a rabbitmq queue and send alert

We are using a message broker called rabbitmq. The code checks the status of number of messages in q queue and sent messages. This is achieved by a curl request to a given API.The script has a sleep ...
1
vote
1answer
333 views

Multithreaded cURL wrapper

The following is a class for curl wrapper. This class will be called like: ...
1
vote
0answers
389 views

C++ - cURL data downloader

I have written cURL based data downloader. It seems to be working as expected, but is there anything, that could be potentionally dangerours? Or something, that should be written differently? Header: ...
4
votes
2answers
2k views

C++ Wrapper for cURL: Multithreading and serializing asynchronous ops

I did this library to help me from one of my projects and decided to publish it on GitHub hoping people might find it useful, convenient and easy to use in their projects too. It's a header-only ...
3
votes
1answer
1k views

Downloading images using CURL

I've written this class that downloads an images, the URLs for which are read from a local .txt file. I'm keen to make sure my code is safe and efficient. ...
4
votes
1answer
663 views

Pool of curl handles

I am trying to write a simple reusable pool of curl handles. I found this wonderful implementation of the blocking queue. The pool itself looks like this: ...
2
votes
1answer
874 views

Combining json responses of recursive web service calls with PHP and curl

I'm implementing the Hotel Price List API from Skyscanner. This requires a first call to the service to implement a session followed by 1 or more calls to the service to get the actual results. I've ...
1
vote
2answers
385 views

Sending email using libcurl - follow-up 2

This question is a continuation of: Sending email using libcurl - follow-up Does this code have any problems? Can I improve it? ...
0
votes
2answers
375 views

Movie data scraping

I enter in the IMDb link and YouTube trailer link in the command line to a movie and the first main program loads all the info about the movie. The second main program uses an IMDb link to the movie ...
3
votes
1answer
803 views

Sending email using libcurl - follow-up

This question is continuation of: Sending email using libcurl I developed a class to send email. Does this code have any problems? Is it thread-safe? ...
3
votes
2answers
4k views

Sending email using libcurl

I developed a function to send email based on this. Does this code have problems? Also, I'm not sure if this code is thread-safe because of the global payloadText ...
1
vote
1answer
49 views

Extracting site visit information from a REST API call, including addresses from a MySQL database

I'm building a web app that pulls data from a ticketing system via REST API. I'm currently able to pull all of the data I need just fine but the loading process is really slow. I'd love any feedback ...
3
votes
1answer
84 views

Parses XML to return the bus times at specified bus stop

The code uses the XML-based OC Transpo data feed to create a list of the bus name, where it's headed, and the times. Keep in mind that I am a beginner at python so any advice at all is appreciated. <...
1
vote
1answer
475 views

Using cURL to retrieve remote image

I am using the following code to retrieve the URL of a random image in a remote folder that I own. As a newbie and although this is working I would like to know if this is done properly, if it could ...
1
vote
2answers
152 views

Crawling SPOJ through cURL and C++

I am trying to write industry standard code. https://www.quora.com/How-do-I-follow-a-user-on-Spoj-for-solving-problems-Refer-Details Someone gave me this A2A. And I wrote this code for it ...
4
votes
2answers
464 views

calloc, malloc, free and realloc wrappers to store the size being allocated

I'm currently building a node.js addon for libcurl. Right now I'm trying to correctly use v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory to ...
1
vote
0answers
21 views

Send Google Cloud Messages

I wrote code which is doing query and insert inside while loop. ...
4
votes
1answer
866 views

Simple load testing script in bash

Here's the code ...
5
votes
0answers
551 views

Reusing curl easy handles in C

In a C project I want to reuse curl easy handles. The flow of program is like: Client --> C Application --> Call URL1, do something, Call URL2, do something, Call URL3... In short, for each client ...
4
votes
1answer
1k views

Pulling data from API, Allowed memory exhausted

I'm working on a project where I pull data (JSON) from an API. I would like to manipulate this data and store this as useful information in my DB (MySQL). My code is working if I would like to make, ...
1
vote
0answers
456 views

URL image validation

I'm trying to write a method to validate an image from a URL. The method will accept an array of image URL. The image should be validated by its type, size and dimensions. Right now, I'm able to ...
1
vote
1answer
94 views

Checking whether a site is up or down

I have this PHP curl function to check if a site is online or not: ...
13
votes
2answers
4k views

Sending an SMS message in C

Recently I've been fiddling with the idea of sending a text message using C. Looking at a few options, I thought that using libcurl to send an SMTP email using TLS for some security would be the best ...
3
votes
1answer
974 views

cURL GET requests receiving XML data

First of all, I would like to know if there is any difference (execution-time) in C between: GET request made by using cURL GET request make by using sockets (BSD sockets) Second, I've done a C ...
2
votes
2answers
4k views

Upload image from Remote Server using URL

This PHP class is to allow user to enter a URL of a remote image file and have it download the image to local server. It will be used in a Markdown editor just like Stack Overflow / Stack Exchange ...
7
votes
1answer
175 views

Testing uptime of my personal server

I made some code to test my personal servers uptime. It logs in to my router page and sees if it returns status 200. A cron job runs it every 5 minutes. Please let me know if I can make the code more ...
1
vote
1answer
127 views

DMZ passthru script

I have a server that cannot be connected to from the internet, but I need to get some info to it. I have another server that can, so I have a simple passthru script that I want to see if you all think ...
9
votes
2answers
3k views

Pinging a URL with libcurl

I've asked a question about pinging a URL before, but I wanted something that was a bit shorter and still just as efficient. libcurl seemed to be the perfect answer. Here is my method: ...
10
votes
3answers
131 views

Dynamic library to intercept oddsock hostname lookups

Just for the fun of it, I decided I would try to create sort of an intermediate DNS system for the oddsock SOCKS proxy. With this, the domain name extension .unet is statically resolved when requested....
5
votes
1answer
142 views

Reverse-engineering with Filepicker API

I have this script to pull data out of the Filepicker API internal. It's mostly reverse-engineering and the code seems to be ugly to me. How can this be improved? ...
8
votes
1answer
248 views

Optimize web-scraping of Moscow grocery website

This code works fine, but I believe it has optimization problems. Please review this. Also, please keep in mind that it stops after each iteration of the loop ...
8
votes
1answer
810 views

Bash script to clone all public repos or gists for a specified user, optionally to a directory of choice

I wrote this script as a way to backup and/or download quickly a set of repos or gists from a user. I don't have any major concerns but I'm a noob at bash scripting, and I've been scouring the ...
4
votes
1answer
3k views

Wrapping Curl, an HTTP client

I have written an HTTP client wrapped the libcurl. It should be able to do HTTP get/post with string/map param, with cookies and proxy. Can somebody review the code? B.T.W., I'm not sure the way ...