I try to use YouTube API, but it has Quotation Marks problem.
SearchResource.ListRequest searchListRequest = yt.Search.List("snippet,contentDetails,statistics");
searchListRequest.ChannelId = channelId;
searchListRequest.MaxResults = 50;
searchListRequest.Order = SearchResource.ListRequest.OrderEnum.Date;
SearchListResponse searchListResult = searchListRequest.Execute();
I expect the output of" Mr Beasts plants 20'000'000 TREES" but the actual output is "Mr Beasts plants 20'000'000 TREES".
I expect the output of "Rating James Charles "Tati" Apology video" but the actual output is "Rating James Charles "Tati" Apology"
This is a known issue of the API (which I already quoted above).
Since your context is C# and .NET, you should employ either of the standard methods HttpUtility.HtmlDecode or WebUtility.HtmlDecode to replace all HTML character references (entities) obtained from the API.
Related
I am not a developer but have used Google search and trial and error test scenarios with Zapier for the last few days and have given up on figuring this out myself. I need help!
I'm using the Run JavaScript code step in Zapier and provided the following details to Input Data.
It says: What input data should we provide to your code (as strings) via an object set to a variable named inputData?
I'm using "street" with a street address example "1402 Spring Garden Rd"
What is the code to use that regardless of the street address provided all the numbers and first space are removed so that the results is "Spring Garden Rd"
Thank you in advance!
var street = inputData;
var streetNoNumbers = inputData.replace(/[0-9]/g, '');
return streetNoNumbers
The error message I'm getting is
TypeError: inputData.replace is not a function
I've learned that strings are immutable and a new string can be made from manipulating another string but doing this in zapier seems to require a function and creating another var with the calculation generates a ... is not a function.
I've tried to write a function but can't get the output or return to show the proper results either.
I can do the following successfully,
var street = inputData
return street
1402 Spring Garden Road
I want to include the code that manipulates street to produce the following:
Spring Garden Road
David here, from the Zapier Platform team. Great question!
The key understanding you're missing is that inputData is a js object with a street property. Before your code is run, we set it up like so:
const inputData = {street: '1402 Spring Garden Rd'}
Since inputData is an object, it doesn't have a replace method (the error you're seeing). Instead, perform your operation on .street and return that.
Try the following:
// need to return an object, not just a string
return {streetNoNumbers: inputData.replace(/[0-9]/g, '')}
If you want to learn more, I recommend our simple examples: https://zapier.com/help/code/#simple-email-extraction
I am programming a LUA Dissector for Wireshark and have read about a VoidString object which could be passed by while creating a ProtoField object. See https://wiki.wireshark.org/LuaAPI/Proto#ProtoField for more information. I would like to no more about this object and what's the purpose of using it. If I am clicking on the link ''VoidString'' an empty page is getting displayed unfortunately because the documentation for this object seems to be missed. I have googled it but found nothing. Any Ideas?
Thanks in Advance!
I have learned from the examples provided by Wireshark that voidString can be passed an table. This table maps the values that you expect with what the value means.
local packet_type = {
[0] = "Data",
[1] = "heartBeat",
[2] = "Keep Alive",
}
local pf_packet_type = ProtoField.uint16("my_discector.packet_type", "Packet Type", base.DEC, packet_type, nil, "This describes a packet type")
This packet will show the string along with the actual value it got instead of just the value. Hope this helps.
I've searched for days looking into this issue but have yet to come up with something. We are migrating our analytics code over to DTM. We are using our own Library hosted at DTM. Everything works great except for some missing data collection parameters in the query string only when using the Adobe Analytics tool to assign variables.
Let me explain. When I use custom code in DTM in a rule to call analytics I get exactly the same query string parameters in the request that we were getting before.
var str = 'string';
s.linkTrackVars = 'prop61,eVar61';
s.linkTrackEvents = 'none';
s.prop61 = str;
s.eVar61 = str;
s.tl(this, 'o', str);
This works fine.
If I try to set eVar61 and prop61 with the Adobe Analytics tool inside a rule, five parameters are no longer in the query string. Specifically 'pev1', 'pid', 'pidt', 'oid' and 'ot'. Is there a way to get DTM to set those parameters or am I just to use custom code for all our rules?
Thanks
Those are clickmap query string parameters. Click on the gear icon to edit the global Analytics tool, and under Link Tracking, make sure 'Enable Clickmap' is checked. Alternatively, you can set s.trackInlineStats=true in your code, which effectively achieves the same effect.
If you ever see missing query string parameters in the future, you can determine what variables to define using the Data Collection Query Parameters in the Marketing Cloud documentation.
I would like to grab the address highlighted in red. "Site Location:" can be easily identified via match(). However, how can I grab the highlighted part only without going over proceeding content, i.e., "You have applied...etc". Please note that the proceeding content won't always start with "You have applied".
What I would do is the following:
Look for "Site Location:"
Grab anything after "Site Location:" until you find empty/blank new line.
Can anyone help me achieving it in Ruby?
Note that the whole text is stored in a string variable.
regex = /\bSite Location:\s+(.*?)\n\s*\n/m
str = "Site Location: Raglan Street
Collingwood Town, Some County
You have applied..."
if md = regex.match(str)
address = md[1].strip.gsub(/^\s+/,'')
puts address
end
Output:
Raglan Street
Collingwood Town, Some County
Note: one thing to watch for is the possibility of different types of newlines. E.g. Microsoft may use \r\n\r\n, etc. in which case you may have to adjust regex accordingly.
I am evaluating OSS to implement crawling, indexing and searching a mid-sized ASP.NET (MVC4) website.
So far it looks promising.
Here are some basic questions, which I could not find in the docs:
German Umlauts:
the Renderer/Search for German Umlauts 'ä, ü, ö' fails:
http://localhost:8080/renderer?use=haas&name=gSearch&query=küche
returns
"küche in the search box with no results - there should be results in the index!"
(I created a query "gSearch" with language=German
can OSS return Synonyms like "...did you mean..." WITHOUT having to manually insert every thinkable or unthinkable synonym MANUALLY??
I did not get results until I added "aspx" in Schema->Parser_list-> HTML -> supported extensions
is this correct - or should I add another parser for ASP - ... can I have more than one parser for HTML, ASP, PDF...etc...?
after doing 3. I got results - both aspx and pdf documents... but I did not get a clickable link (filename) for the PDF-Files ??
what would be the best way to call search from MVC? Via Webservices...? I do not want to include an IFRAME
It's always troublesome when several different questions are gathered in one., but here's my take on number 4:
I use a WebRequest, very straightforward.
var webRequest = WebRequest.Create("http://localhost:8080/select?use=haas&query=kitchen");
webRequest.Timeout = 10000;
WebResponse webResponse;
try
{
webResponse = webRequest.GetResponse();
}
catch (WebException ex)
{
WriteToEventLog(ex.Message);
}
var xmlStream = webResponse.GetResponseStream();
var reader = XmlReader.Create(xmlStream);
var doc = XDocument.Load(reader, LoadOptions.PreserveWhitespace);
Then you have yourself an XML with the returned fields set up in your OSS index query.