Extract list of url from a page using importxml - google-sheets

is a way to scrape all the links from this list using importxml ?
The page is :
http://www.derecho.uba.ar/academica/asuntos_estudiantiles/pasantias/ofertas_anteriores.php
When i use this xpath only returns the name of the links , not the urls
//*[contains(concat( " ", #class, " " ), concat( " ", "listaLinks", " " ))]//a
It gives me "General Motors de Argentina S.R.L." when i want the url of that link , i need the url of all the different names of that list

You probably want //*[contains(concat( " ", #class, " " ), concat( " ", "listaLinks", " " ))]//a/#href

Related

Is there an api endpoint to list files in private chat?

I am looking for a way to get the number of files in a private chat using the Microsoft Graph API.
Currently I can get the messages from private chat using:
beta/users/{user_id}/chats/{chat_id}/messages
Another API is the 'List children of a driveItem' - https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http to get the number of files for a channel - that looks like this:
/teams/{team_id}/channels/{channel_id}/messages
And get a response like this:
value ': [{
' id ': ' 123456'},
' user ': {' displayName ': ' Username ',
' folder ': {' childCount ': 9}]
And I can access the childCount parameter
Problem is, that it receives only team ID - and not chat ID.
So I am looking for an API that just receive the chat ID and send in response the information, just the the 'List children of a driveItem' API
If there is a way to get the drive-id of a private chat it would be good as well since I will use the same list children API and it should work, right?
Thanks!
Chats threads don't have a drive as only teams have a drive associated with them.
However you can get the list of all chat messages which contains attachments[] for files shared in private chat using below API:
beta/users/{user_id}/chats/{chat_id}/messages
So here ChatId is available along with the attachments[] like below:
"attachments": [
{
"id": "4a000672-3234-4306-8c01-b6e6fea43f22",
"contentType": "reference",
"contentUrl": "https://m365x645306.sharepoint.com/sites/SiteName/Shared Documents/Test/My-Tasks.csv",
"content": null,
"name": "My-Tasks.csv",
"thumbnailUrl": null
}
],
So based on the attachments, you can get the number of files attached in this private chat along with it's SharePoint content URL.

Slack message "link button" not showing when URL contains underscore

I searched high and low but couldn't find a solution for this...
I'm designing a basic slack message with link buttons and found that the button will not show in the message when the host contains an 'underscore'...
You can try below example here: https://api.slack.com/docs/messages/builder
{
"text": "some text here...",
"attachments": [
{
"title": "TITLE",
"actions": [
{
"type": "button",
"text": "Link button",
"url": "https://www.some-site.com"
}
]
}
]
}
When you change www.some-site.com to www.some_site.com, the button disappears ...
Any suggestions on how to format the url so that the button shows up? According to the documentation, only the &, < and > characters need to be escaped, correct? I also tried encoding the URL, that didn't help either ... help?
This is a valid response from Slack, since www.some_site.com is not a valid URL.
You can not use underscores in hostnames, where hostname in your example is some-site. You can however use underscores in the label of a URL, so e.g. www_super.some-site.com should work.
Sources:
- https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
- http://domainkeys.sourceforge.net/underscore.html

How to pass html code in jqm calendar summary

I have used jqm calendar for events list. Its showing perfect and showing list according to date. but now I want to link events list to their detail page so I need to pass html code means summary as a link so when list show below the calendar its can be likable and when I click it redirect to its detail page. below are my code
{"summary": Event Name',
"begin": new Date(2015,8,24 ),
"end": new Date(2015,8,24)}
but its showing me title as it as above not making it linkable title.
please sugggest
I found solution for this you can pass url in url key. see below code:-
{"summary": "Test Event name here",
"url":"your url here",
"begin": new Date(2015,8,24 ),
"end": new Date(2015,8,24)
}

Mandrill ignores line breaks (\n)

Using the send-template method and the Lutung Mandrill Java API implementation, when a template variable contains line breaks of the form \n, they are totally ignored or stripped on generated emails. The Strings containing \n characters are kept untouched untill the GET send-template method is executed. So I guess there is some String analysis and conversion on Mandrill servers which removes special characters.
How can I make work again line breaks on Mandrill emails?
In my case I am using Handlebars for mandrill templates and I have solved this by sending HTML to the template <br/> instead of \n by replacing \n in my string with <br/> something like: .Description.Replace("\n", "<br/>");
And then on the mandrill template I put the variable inside {{{ variable }}} instead of {{ variable }}
http://blog.mandrill.com/handlebars-for-templates-and-dynamic-content.html
HTML escaping
Handlebars HTML-escapes values returned by an
{{expression}}. If you don't want Handlebars to escape a value, use
the "triple-stash", "{{{.
In your template:
<div> {{{html_tag_content}}} </div> In your API request:
"global_merge_vars": [ {
"name": "html_tag_content",
"content": "This example<br>is all about<br>the magical world of handlebars" } ]
The result:
This example
is all about
the magical world of handlebars
If you want to send more complex content, be it html, or variables with break lines and whatnot, you can first render the template and then send the message, instead of directly using send-template.
Render the template with a call to templates.render:
{
"key": "example key",
"template_name": "Example Template",
"template_content": [
{
"name": "editable",
"content": "<div>content to inject *|MERGE1|*</div>"
}
],
"merge_vars": [
{
"name": "merge1",
"content": "merge1 content\n contains line breaks"
}
]
}
Save the result to a variable rendered_content.
Send the message using the rendered template with messages.send:
{
"message": {
"html": rendered_content,
...
...
}

Why is my JSON which contains HTML causing errors?

My JSON that is being returned from my ASP.NET MVC application looks like this:
{code: "1", error: "0", output: "<div class="a1"><div class="b1">this is fasta's</div></div>}
It is not working because I am not escaping it properly.
I'm not using a JSON library, can someone recommend a function that would clean up my HTML so this works?
I tried escaping for \ but it still doesn't work.
If I HTML encode it, should it work fine?
There will be user generated content so this has to work for all potential inputs by the user.
Are you able to use single quotes to wrap your HTML attribute values? I think that should work if you are able to do that.
For example,
{code: "1", error: "0", output: "<div class='a1'><div class='b1'>this is fasta's</div></div>"}
If that doesn't work, try using 2 backslashes to escape the double quotes.
For example,
{code: "1", error: "0", output: "<div class=\\"a1\\"><div class=\\"b1\\">this is fasta's</div></div>"}
You need to escape the internal double quotes, like this:
{code: "1", error: "0", output: "<div class=\"a1\"><div class=\"b1\">this is fasta's</div></div>"}

Resources