I want to download or link the featured image url of my blog post with social media posts. Please help me in this regard. Thanks
Welcome to the Make community!
Please provide the link to your blog post. We can’t help you to download it if we don’t know how to fetch it.
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!
Here is the blog link: https://dev4.purplecowservices.com/why-digital-marketing-is-vital-for-your-ecommerce-business/
Welcome to the Make community!
You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):
<div class="post-media.+?"><img.+?src="(?<image>[^"]+)"
Proof
https://regex101.com/r/fIJBD7/1
Important Info
- Global match must be set to NO!
Output
For more information, see Text Parser in the Make Help Center:
Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.
- The complete list of metacharacters can be found on the MDN web docs website.
- For a tutorial on how to create regular expressions, we recommend the RegexOne website.
- For an easy, quick regex generator, try the Regular Expressions generator.
- For experimenting with regular expressions, we recommend the regular expressions 101 website. Just make sure to tick the ECMAScript (JavaScript) FLAVOR in the left panel.
Hope this helps!
Module Export
You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.
-
Copy the JSON code below by clicking the copy button when you mouseover the top-right of the code block
-
Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the canvas.
-
Click on each imported module and save it for validation. You may be prompted to remap some variables and connections.
Click to Expand Module Export Code
JSON - Copy and Paste this directly in the scenario editor
{
"subflows": [
{
"flow": [
{
"id": 35,
"module": "http:ActionSendData",
"version": 3,
"parameters": {
"handleErrors": true,
"useNewZLibDeCompress": true
},
"mapper": {
"url": "https://dev4.purplecowservices.com/why-digital-marketing-is-vital-for-your-ecommerce-business/",
"serializeUrl": false,
"method": "get",
"headers": [],
"qs": [],
"bodyType": "",
"parseResponse": false,
"authUser": "",
"authPass": "",
"timeout": "",
"shareCookies": false,
"ca": "",
"rejectUnauthorized": true,
"followRedirect": true,
"useQuerystring": false,
"gzip": true,
"useMtls": false,
"followAllRedirects": false
},
"metadata": {
"designer": {
"x": -1,
"y": -1264
},
"restore": {
"expect": {
"method": {
"mode": "chose",
"label": "GET"
},
"headers": {
"mode": "chose",
"collapsed": true
},
"qs": {
"mode": "chose",
"collapsed": true
},
"bodyType": {
"collapsed": true,
"label": "Empty"
},
"parseResponse": {
"collapsed": true
}
}
},
"parameters": [
{
"name": "handleErrors",
"type": "boolean",
"label": "Evaluate all states as errors (except for 2xx and 3xx )",
"required": true
},
{
"name": "useNewZLibDeCompress",
"type": "hidden"
}
],
"expect": [
{
"name": "url",
"type": "url",
"label": "URL",
"required": true
},
{
"name": "serializeUrl",
"type": "boolean",
"label": "Serialize URL",
"required": true
},
{
"name": "method",
"type": "select",
"label": "Method",
"required": true,
"validate": {
"enum": [
"get",
"head",
"post",
"put",
"patch",
"delete",
"options"
]
}
},
{
"name": "headers",
"type": "array",
"label": "Headers",
"spec": [
{
"name": "name",
"label": "Name",
"type": "text",
"required": true
},
{
"name": "value",
"label": "Value",
"type": "text"
}
]
},
{
"name": "qs",
"type": "array",
"label": "Query String",
"spec": [
{
"name": "name",
"label": "Name",
"type": "text",
"required": true
},
{
"name": "value",
"label": "Value",
"type": "text"
}
]
},
{
"name": "bodyType",
"type": "select",
"label": "Body type",
"validate": {
"enum": [
"raw",
"x_www_form_urlencoded",
"multipart_form_data"
]
}
},
{
"name": "parseResponse",
"type": "boolean",
"label": "Parse response",
"required": true
},
{
"name": "authUser",
"type": "text",
"label": "User name"
},
{
"name": "authPass",
"type": "password",
"label": "Password"
},
{
"name": "timeout",
"type": "uinteger",
"label": "Timeout",
"validate": {
"max": 300,
"min": 1
}
},
{
"name": "shareCookies",
"type": "boolean",
"label": "Share cookies with other HTTP modules",
"required": true
},
{
"name": "ca",
"type": "cert",
"label": "Self-signed certificate"
},
{
"name": "rejectUnauthorized",
"type": "boolean",
"label": "Reject connections that are using unverified (self-signed) certificates",
"required": true
},
{
"name": "followRedirect",
"type": "boolean",
"label": "Follow redirect",
"required": true
},
{
"name": "useQuerystring",
"type": "boolean",
"label": "Disable serialization of multiple same query string keys as arrays",
"required": true
},
{
"name": "gzip",
"type": "boolean",
"label": "Request compressed content",
"required": true
},
{
"name": "useMtls",
"type": "boolean",
"label": "Use Mutual TLS",
"required": true
},
{
"name": "followAllRedirects",
"type": "boolean",
"label": "Follow all redirect",
"required": true
}
]
}
},
{
"id": 36,
"module": "regexp:Parser",
"version": 1,
"parameters": {
"pattern": "<div class=\"post-media.+?\"><img.+?src=\"(?<image>[^\"]+)\"",
"global": false,
"sensitive": true,
"multiline": false,
"singleline": false,
"continueWhenNoRes": false
},
"mapper": {
"text": "{{toString(35.data)}}"
},
"metadata": {
"designer": {
"x": 246,
"y": -1263,
"messages": [
{
"category": "last",
"severity": "warning",
"message": "A transformer should not be the last module in the route."
}
]
},
"restore": {},
"parameters": [
{
"name": "pattern",
"type": "text",
"label": "Pattern",
"required": true
},
{
"name": "global",
"type": "boolean",
"label": "Global match",
"required": true
},
{
"name": "sensitive",
"type": "boolean",
"label": "Case sensitive",
"required": true
},
{
"name": "multiline",
"type": "boolean",
"label": "Multiline",
"required": true
},
{
"name": "singleline",
"type": "boolean",
"label": "Singleline",
"required": true
},
{
"name": "continueWhenNoRes",
"type": "boolean",
"label": "Continue the execution of the route even if the module finds no matches",
"required": true
}
],
"expect": [
{
"name": "text",
"type": "text",
"label": "Text"
}
],
"interface": [
{
"type": "text",
"name": "image",
"label": "image"
}
]
}
}
]
}
],
"metadata": {
"version": 1
}
}
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!