In the demo, it can analyze plain text
But in the API reference all REST APIs require url. And they don't seem to support analyze text directly. I tried to use text in a POST form anyway. But I got error.
{
"status": "ERROR",
"statusInfo": "invalid-url"
}
This is more a documentation issue, than a coding issue. In the documentation you will see three buttons. Select the Text one to get the documentation on Text calls.
Related
I am trying to format the content of 'Text Area' when using WordPress's Advanced Custom Fields. I am using React to build the project.
In an attempt to debug, I have been following this documentation and set my options to resemble the image referenced. Including Text Area as one of my custom fields and setting the New Lines option to Automatically add paragraphs
The documentation then goes on to show an example using PHP to render the content.
I am using graphQL to fetch my data, and delivering the contents as follows:
<div className="media-description-area">
{this.props.activeDescription}
</div>
with activeDescription being destructured from the object that the GraphQL request delivers.
The text as its being set in the field itself looks like this, with spacing included:
The formatting tags are being rendered directly into the string itself, this how it is appearing in the document:
Does anyone know how why this is? I am referring to the field directly so it appears as this formatting is being delivered from WordPress itself
activeDescription: objects[0].items[0].projectDescription,
Thank You
I'm trying to use a REST web service from Geonames.org. When I try to manually put in the url with the parameters, it would only return the Country Code. I've tried to search for ways to implement it, but most of what I've seen return JSON text with multiple keys and data. I feel like the answer should be pretty simple, but I'm unsure.
I'm trying to use this for a React project I'm working on.
Here is an example of what the url returns
Just looked into the docs of that API, and it says if you want to receive JSON responses simply add JSON keyword to the endpoint. Like here for given endpoint you have:
http://api.geonames.org/countryCodeJSON?formatted=true&lat=47.03&lng=10.2&username=demo
so just change countryCode to countryCodeJSON.
Source: http://www.geonames.org/export/JSON-webservices.html
Checked all the similar questions suggested and couldn't find an answer, unfortunately.
Is there a way to send a multi-line message to metamask via web3.eth.personal.sign as the first parameter? (The problem is how to get multiple lines, not how to actually send a message there)
A more eloquent example of my question can be seen in the image attached. There are multiple paragraphs on separate lines: 'Welcome to OpenSea!', 'Click "Sign" to sign in..." etc.
Thanks a lot!
You can either use \n or use instead of '' or "" when you send the message. The option with takes the spacing in the content into consideration (in js).
I'm using Google's Structured Data Testing Tool to investigate why Google isn't finding any structured data on my page.
On first loading the URL (https://www.languagesunited.co.uk), I get an "Uncategorised Error":
JSON-LD Missing '}' or object member name.
Within the test tool source windows, I can making a small change to the page (add a space somewhere) and re-run the validation, and it validates (except for the url needing to be www.example.com for the tool to work).
I'd be grateful for any advice if anyone has had a similar problem.
After some experimenting with different options and getting different results with the test tool, the answer was very simple. There were some invalid whitespace characters in my structured data. Switching on the "show invisibles" option in my editor allowed me to replace these with spaces, and the data validated successfully.
Both are, most likely, bugs in the SDTT.
If you paste the markup (instead of letting it fetch the URL), the SDTT detects the structured data immediately (letting it fetch first and then editing something in the detected markup is the same idea). So there’s probably something wrong with their URL fetching.
For the issue with the example domain, see these questions:
Google structured data error: “All values provided for http://www.example.com/ must have the same domain.”
Google SDTT error: “All values provided for http://www.example.com/ must have the same domain.”
Schema.org and ContactPoint use with validation failure: “All values provided for http://www.example.com/ must have the same domain.” (on Webmasters SE)
I've just realized that Google Structured Data Validation Tool requires you (or us) to include context, In example:
'#context': 'https://schema.org',
(schema.org includes it in all their examples, i.e.:
Example encoded as JSON-LD in a HTML script tag.
<script type="application/ld+json">
{
"#context": "https://schema.org/",
"#type": "Person",
"name": "Christopher Froome",
"sponsor":
{
"#type": "Organization",
"name": "Sky",
"url": "http://www.skysports.com/"
}
}
</script>
If you do so you will start getting results again.
I was watching some videos on Egghead.io about AngularJS. The creator of the videos uses Webstorm (and, I believe, works for them). One feature I noticed is that he can set different syntax highlighting within different scopes or quotation marks. So, in code like the following (from an AngularJS directive)
return {
template: '<div>something</div>',
// ^^^ these guys ^^^
}
...he can get the inside of the quotation marks to highlight as HTML.
I use Sublime Text 2, and am fairly wedded to it. Is there an existing feature/plugin for Sublime that could handle a case like this? If not, is something like this technically possible using the Sublime Text 2 API?
I don't think it's built in, but it's certainly possible. I've been doing some work with graphviz and wanted to do something similar. Labels can be generated with html like syntax. Anyways, I played around with the .tmLanguage file and added a new pattern to match the context where html like entries were valid (I look for label = <). The patterns I used for the captures aren't that good, but it works for fine for me. This give me the following, which I think is similar to what you are looking for.
I don't know anything about AngularJS, so I can't help you with anything specific to that, but it is certainly possible. Note that in the image below, the last <table></table> are just to show that highlighting doesn't occur there.
Edit:
Forgot to include this in the original post, but here is my updated tmLangauage file. That first pattern is what I added(link). I used PlistJsonConverter to go from JSON to plist, then saved the file as .tmLanguage. Hope this helps.
#skuroda is right, I implemented #skuroda's code with an additional plugin to easily edit HTML within an AngularJS directive JS file. The result is HTML syntax highlighting within a directive JS file and additional functionality to remove string related delimiters while editing templates.... Sublime AngularJS HTML Template Plugin