Skip to content

Instantly share code, notes, and snippets.

View imoutsatsos's full-sized avatar

Ioannis K. Moutsatsos imoutsatsos

  • Novartis (ioannis.moutsatsos@novartis.com)
  • Arlington, MA
  • X @ioannismou
View GitHub Profile
@ivan-pinatti
ivan-pinatti / jenkins-set-global-shared-library.groovy
Created May 21, 2018 18:39
Jenkins - Set Global Share Library plugin parameters via groovy script - #jenkins #groovy #library #shared #sharedLibrary
#!groovy
// imports
import hudson.scm.SCM
import jenkins.model.Jenkins
import jenkins.plugins.git.GitSCMSource
import org.jenkinsci.plugins.workflow.libs.*
import org.jenkinsci.plugins.workflow.libs.LibraryConfiguration
import org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever
@sagrawal31
sagrawal31 / DownloadURLs.groovy
Last active May 4, 2022 10:10
A simple Groovy script to scrape all URLs from a given string and download the content from those URLs
import java.util.regex.Matcher
import java.util.regex.Pattern
Pattern urlPattern = Pattern.compile("\\b(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]",Pattern.CASE_INSENSITIVE);
String urlString = """This is a big string with lots of Image URL like: http://i.istockimg.com/file_thumbview_approve/69656987/3/stock-illustration-69656987-vector-of-flat-icon-life-buoy.jpg and
http://i.istockimg.com/file_thumbview_approve/69943823/3/stock-illustration-69943823-beach-ball.jpg few others below
http://i.istockimg.com/file_thumbview_approve/40877104/3/stock-photo-40877104-pollen-floating-on-water.jpg
http://i.istockimg.com/file_thumbview_approve/68944343/3/stock-illustration-68944343-ship-boat-flat-icon-with-long-shadow.jpg
"""