Sponsored Content
Full Discussion: Filter output in curl
Top Forums Shell Programming and Scripting Filter output in curl Post 302913959 by genius90 on Thursday 21st of August 2014 03:29:14 AM
Old 08-21-2014
Filter output in curl

Hello guys,

I'm writing a little script which sends me sms with my shell script via api of a sms provider.

problem is I can't filter my curl output for this site:

site url:
Code:
http://fahrplan.oebb.at/bin/query.exe/dn?start=1&_charset=UTF-8&REQ0JourneyProduct_list=0:1111111111011000-000000.&SALL=1&ZALL=1&scotty_advancedSearchMode=0&S=mureck&Z=graz%20puntigam&REQ0JourneyDate=21.08.2014&time=04:00&timeSel=depart

this is what i got so far, but I don't know how to filter everything out, I just want the times and also only the "ab time" like
Quote:
05:08 ab
Code:
#!/bin/bash
URL='http://fahrplan.oebb.at/bin/query.exe/dn?start=1&_charset=UTF-8&REQ0JourneyProduct_list=0:1111111111011000-000000.&SALL=1&ZALL=1&scotty_advancedSearchMode=0&S=mureck&Z=graz%20puntigam&REQ0JourneyDate=21.08.2014&time=04:00&timeSel=depart'

echo "Now:" `date +%H:%M:%S`
for URL in $URLS; do
echo "$URL:" | sed 's/.*=.*=/Route /'
curl -s $URL \

done

cheers
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

let curl output to stdout AND save to a file

hello hackers. i have a curl process running as cgi directly pushing stdout to the client. but i want to additionally save that stream to a file at the same time. any directions madly welcome. thanks in advance (3 Replies)
Discussion started by: scarfake
3 Replies

2. IP Networking

Filter wireshark output

Hi I have a wireshark file saved (from my network) and I have to analyze the flows inside it. The problem is that i have to analyze not the complete file (60.000 pkts!) but just a subset of it. In other words i have to sample the wireshark.file.dump and for example from 60.000 pkts take... (2 Replies)
Discussion started by: Dedalus
2 Replies

3. Shell Programming and Scripting

script to output curl result as html

hi, new to scripting and would like to know how can I have a script which will curl a few URLs and have the results such as the URLs being curled, dns lookup time, connection time, total time, etc save in a html format in a form of table with column and rows. thank you. (4 Replies)
Discussion started by: squidusr
4 Replies

4. Shell Programming and Scripting

Getting cURL to output verbose to a file

This is about to drive me crazy. What I want to do is simple: output ALL the verbose information from curl to a file I have read the manual, tried several options and searched this forum but no salvation... I'm using curl -k -Q "command" --user user:passwd --ftp-pasv --ftp-ssl -v... (1 Reply)
Discussion started by: caramandi
1 Replies

5. Shell Programming and Scripting

web service call: curl output to xsltproc input

I need to invoke a web service and extract what I need from the response using a combination of curl and xsltproc. However, any file-based parameters that must be supplied to both these programs must be from stdin and not actual files. At least with curl, it seems to think that I am supplying a... (3 Replies)
Discussion started by: webuser
3 Replies

6. Shell Programming and Scripting

ery weird wget/curl output - what should I do?

Hi, I'm trying to write a script to download RedHat's errata digest. It comes in a txt.gz format, and i can get it easily with firefox. HOWEVER: output is VERY strange when donwloading it in a script. It seems I'm getting a file of the same size - but partially text and partly binary! It... (5 Replies)
Discussion started by: jstilby
5 Replies

7. Shell Programming and Scripting

Encapsulating output of CURL and/or WGET

i use curl and wget quite often. i set up alarms on their output. for instance, i would run a "wget" on a url and then search for certain strings within the output given by the "wget". the problem is, i cant get the entire output or response of my wget/curl command to show up correctly in... (3 Replies)
Discussion started by: SkySmart
3 Replies

8. Shell Programming and Scripting

How the filter output?

Hey, I'm using some sensors that can be read by http. If I run following command: curl -v 'http://192.168.111.23:8080/sensor/52f5c63cc4221fbbedcb499908a0a823?version=1.0&interval=minute&unit=watt&callback=realtime' I'm getting: I would like to put this now in a sheet with only the... (9 Replies)
Discussion started by: brononius
9 Replies

9. Shell Programming and Scripting

Extracting urls from curl output

Hello. I use curl to fetch a website, then, I want to extract the URLs from this curls output. I tried both sed and grep, but couldnt figure it out. Ive tried : sed -n 's/href="\(*\).*/\1/p' results.txt and grep -o grep -o '<a href="http://*.*.*/*">' results.txt. What pattern... (6 Replies)
Discussion started by: jozo95
6 Replies

10. Web Development

Filename output in curl

How can I get the name of the default output filename from curl using the argument -O? Using -o one can choose a filename. I want to get the name of the original file, but don't understand how to get it. curl -o filename http://www.website.com curl -O http://www.website.com The... (3 Replies)
Discussion started by: locoroco
3 Replies
CURLOPT_SSL_VERIFYPEER(3)				     curl_easy_setopt options					 CURLOPT_SSL_VERIFYPEER(3)

NAME
CURLOPT_SSL_VERIFYPEER - verify the peer's SSL certificate SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_VERIFYPEER, long verify); DESCRIPTION
Pass a long as parameter to enable or disable. This option determines whether curl verifies the authenticity of the peer's certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't. When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. Curl verifies whether the certificate is authentic, i.e. that you can trust that the server is who the certificate says it is. This trust is based on a chain of digital signa- tures, rooted in certification authority (CA) certificates you supply. curl uses a default bundle of CA certificates (the path for that is determined at build time) and you can specify alternate certificates with the CURLOPT_CAINFO(3) option or the CURLOPT_CAPATH(3) option. When CURLOPT_SSL_VERIFYPEER(3) is enabled, and the verification fails to prove that the certificate is authentic, the connection fails. When the option is zero, the peer certificate verification succeeds regardless. Authenticating the certificate is not enough to be sure about the server. You typically also want to ensure that the server is the server you mean to be talking to. Use CURLOPT_SSL_VERIFYHOST(3) for that. The check that the host name in the certificate is valid for the host name you're connecting to is done independently of the CURLOPT_SSL_VERIFYPEER(3) option. WARNING: disabling verification of the certificate allows bad guys to man-in-the-middle the communication without you knowing it. Disabling verification makes the communication insecure. Just having encryption on a transfer is not enough as you cannot be sure that you are commu- nicating with the correct end-point. DEFAULT
By default, curl assumes a value of 1. PROTOCOLS
All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); /* Set the default value: strict certificate check please */ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L); curl_easy_perform(curl); } AVAILABILITY
If built TLS enabled. RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_SSL_VERIFYHOST(3), CURLOPT_PROXY_SSL_VERIFYPEER(3), CURLOPT_PROXY_SSL_VERIFYHOST(3), libcurl 7.54.0 February 09, 2017 CURLOPT_SSL_VERIFYPEER(3)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy