I have json-ld script which shows job posts google jobs section.
<script type="application/ld+json">
{
"#context" : "https://schema.org/",
"#type" : "JobPosting",
"title" : "<?php echo($title); ?>",
"description" :"<?php echo($description); ?>",
"hiringOrganization" : {
"#type" : "Organization",
"name" : "<?php echo($name); ?>",
"logo" : "example.com/images/<?php echo($id);?>.jpg"
},
"jobLocation": {
"#type": "Place",
"address": {
"#type": "PostalAddress",
"streetAddress": "MW",
"addressLocality": "Moscow",
"addressRegion": "Russia",
"addressCountry": "RU",
"postalCode": ""
}
},
"baseSalary": {
"#type": "MonetaryAmount",
"currency": "RUB",
"value": {
"#type": "QuantitativeValue",
"value": "1500",
"unitText": "HOUR"
}
},
"datePosted" : "2021-06-21",
"validThrough" : "2021-08-18T00:00",
"employmentType": "FULL_TIME"
}
</script>
for the 1st post it worked, I can find the vacancy on Google Jobs section. However when I add more job posts it is not showing, I tested them here says it is ok.
robots.txt content : Sitemap: https://example.com/sitemap.xml
sitemap.xml content :
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com</loc>
<lastmod>2021-06-21</lastmod>
</url>
</urlset>
And job posts url is https://example.com/posts/71.php 72 and so on.
Anyone who can help with this?
Creating structured data for a job listing is contrary to Google's guidelines:
Put structured data on the most detailed leaf page possible. Don't add
structured data to pages intended to present a list of jobs (for
example, search result pages).
About the test validity of your structured data. Automated testing tools can skip content compliance with some Google requirements. Read more of General structured data guidelines:
These guidelines are not easily testable using an automated tool.
In my case sitemap wasn't set correctly. Make sure your sitemap sees the posts
Discovered URLs 170
Related
I have problems extracting attribute text from Image tag using the Facebook Instant Articles SDK Transformer
I cannot figure out the rules.json required to extract the text from alt attribute and make a caption out of it.
//MARKUP
<img src="https://upload.wikimedia.org/wikipedia/commons/8/84/Example.svg" alt="Foto By: Bla Bla"/>
//RULES.JSON
{
"class": "ImageRule",
"selector" : "img",
"properties" :
{
"image.url" :
{
"type" : "string",
"selector" : "img",
"attribute": "src"
},
"image.caption" :
{
"type" : "string",
"selector" : "img",
"attribute" : "alt"
}
}
}
Expected results are Facebook Instant Article compliant markup like:
<figure>
<img src="https://upload.wikimedia.org/wikipedia/commons/8/84/Example.svg"/>
<figcaption>Foto By: Bla Bla</figcaption>
</figure>
What I get is Uncaught Error: Call to a member function hasChildNodes() on string in /Facebook/InstantArticles/Transformer/Transformer.php on line 305.
Somehow image gets processed, the caption gets processed, I get the correct value but then it recursively again enters transform function passing in the extracted "alt" string and it fails because it expects an HTML Node input not a String.
Facebooks documentation on the matter is extremely vague so if anyone has some experience dealing with Facebook Instant Articles please chime in.
shitty docs can be found here:https://developers.facebook.com/docs/instant-articles/sdk/transformer/
https://developers.facebook.com/docs/instant-articles/sdk/transformer-rules
main committer of SDK here.
You can check the setup we have into the SimpleTransformerTest.php that covers exactly your need. You can also use any tests to play around with the Transformer.
What you are doing wrong is the selector for the image.caption that should be a type of element.
For your Rules.json it should look like:
{
"class": "CaptionRule",
"selector" : "//img[#alt]",
"properties" : {
"caption.default": {
"type": "string",
"selector": "img",
"attribute": "alt"
}
}
},
{
"class": "ImageRule",
"selector" : "figure",
"properties" :
{
"image.url" :
{
"type" : "string",
"selector" : "img",
"attribute": "src"
},
"image.caption" :
{
"type" : "element",
"selector" : "img"
}
}
}
Check that I'm using a different strategy instead of going straight to the <img> element on the ImageRule, I'm picking the <figure> tag, so then we can keep the transformer intact.
Note that the rules.json are applied bottom up.
Let me know if this covers your need.
Is there any way to limit the results returned by the Google Books API?
For example the following URL:
https://www.googleapis.com/books/v1/volumes?q=isbn:0751538310
Returns the following:
"kind": "books#volumes",
"totalItems": 1,
"items": [
{
"kind": "books#volume",
"id": "ofTsHAAACAAJ",
"etag": "K6a+5IuCMD0",
"selfLink": "https://www.googleapis.com/books/v1/volumes/ofTsHAAACAAJ",
"volumeInfo": {
"title": "Panic",
"authors": [
"Jeff Abbott"
],
"publisher": "Grand Central Publishing",
"publishedDate": "2006",
"description": "Things are going well for young film-maker Evan Casher - until he receives an urgent phonecall from his mother, summoning him home. He arrives to find her brutally murdered body on the kitchen floor and a hitman lying in wait for him. It is then he realises his whole life has been a lie. His parents are not who he thought they were, his girlfriend is not who he thought she was, his entire existence an ingeniously constructed sham. And now that he knows it, he is in terrible danger. So he is catapulted into a violent world of mercenaries, spies and terrorists. Pursued by a ruthless band of killers who will stop at nothing to keep old secrets buried, Evan's only hope for survival is to discover the truth behind his past. An absolute page-turner, Panic has been acclaimed as one of the most exciting thrillers of recent years.",
"industryIdentifiers": [
{
"type": "ISBN_10",
"identifier": "0751538310"
},
{
"type": "ISBN_13",
"identifier": "9780751538311"
}
],
"readingModes": {
"text": false,
"image": false
},
"pageCount": 408,
"printType": "BOOK",
"categories": [
"Austin (Tex.)"
],
"maturityRating": "NOT_MATURE",
"allowAnonLogging": false,
"contentVersion": "preview-1.0.0",
"imageLinks": {
"smallThumbnail": "http://books.google.com/books/content?id=ofTsHAAACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api",
"thumbnail": "http://books.google.com/books/content?id=ofTsHAAACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api"
},
"language": "en",
"previewLink": "http://books.google.co.uk/books?id=ofTsHAAACAAJ&dq=isbn:0751538310&hl=&cd=1&source=gbs_api",
"infoLink": "http://books.google.co.uk/books?id=ofTsHAAACAAJ&dq=isbn:0751538310&hl=&source=gbs_api",
"canonicalVolumeLink": "https://books.google.com/books/about/Panic.html?hl=&id=ofTsHAAACAAJ"
},
"saleInfo": {
"country": "GB",
"saleability": "NOT_FOR_SALE",
"isEbook": false
},
"accessInfo": {
"country": "GB",
"viewability": "NO_PAGES",
"embeddable": false,
"publicDomain": false,
"textToSpeechPermission": "ALLOWED",
"epub": {
"isAvailable": false
},
"pdf": {
"isAvailable": false
},
"webReaderLink": "http://books.google.co.uk/books/reader?id=ofTsHAAACAAJ&hl=&printsec=frontcover&output=reader&source=gbs_api",
"accessViewStatus": "NONE",
"quoteSharingAllowed": false
},
"searchInfo": {
"textSnippet": "An absolute page-turner, Panic has been acclaimed as one of the most exciting thrillers of recent years."
}
}
]
Is there any way I can return only the title and description? I think it may improve performance of my web application.
I have looked at the partial response but it doesn't seem to work.
I am including my API key in the URL query parameter.
Thanks
I added the params according to the partial response documentation.
See the params in following link:
https://www.googleapis.com/books/v1/volumes?q=isbn:0751538310&fields=items(volumeInfo/description,volumeInfo/title)
It will return:
{
"items": [
{
"volumeInfo": {
"title": "Panic",
"description": "Things are going well for young film-maker Evan Casher - until he receives an urgent phonecall from his mother, summoning him home. He arrives to find her brutally murdered body on the kitchen floor and a hitman lying in wait for him. It is then he realises his whole life has been a lie. His parents are not who he thought they were, his girlfriend is not who he thought she was, his entire existence an ingeniously constructed sham. And now that he knows it, he is in terrible danger. So he is catapulted into a violent world of mercenaries, spies and terrorists. Pursued by a ruthless band of killers who will stop at nothing to keep old secrets buried, Evan's only hope for survival is to discover the truth behind his past. An absolute page-turner, Panic has been acclaimed as one of the most exciting thrillers of recent years."
}
}
]
}
maxResults
include this in your query. 5 is just an integer.
&maxResults=5
Google will help you create your API with this website API called try it.
https://developers.google.com/books/docs/v1/reference/volumes/list?apix=true#try-it
Maybe its too late to respond but you need to activate the API before accessing it. When you try to access it says to activate it from console with some project id. Just copy that url and it takes you straight to your dashboard where you can find your activation button post which you can access the partial response with desired attributes.
I'm using the WooCommerce REST API (http://woocommerce.github.io/woocommerce-rest-api-docs/#introduction) and have added a new field (shipping_phone) to the checkout page using their example here:
https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
This new field appears on the checkout page and I can populate this and it is saved to my order - here's how it appears in the WordPress admin page for an order:
I'm now trying to download the Order with the shipping_phone data by using this GET request:
/wp-json/wc/v1/orders/3454
but the shipping_phone field isn't included in the downloaded fields. Here's the Shipping fields from the GET response:
"shipping": {
"address_1": "45 Jones Road",
"address_2": "",
"city": "Bondi",
"company": "BS Consulting Pty Ltd",
"country": "AU",
"first_name": "Betty",
"last_name": "Sanders",
"postcode": "2026",
"state": "NSW"
},
It's also not located anywhere else in the JSON data. How do I do a GET request to get an Order which includes this new custom field?
You can use the WooCommerce REST API v2 or later to get the Order Meta Data which includes these custom fields. If you GET an Order:
wp-json/wc/v3/orders/3454
it will include a meta_data array with these custom field values:
"meta_data" :
[
{
"id" : 4672,
"key" : "_shipping_method",
"value" : [ "flat_rate:1" ]
},
{
"id" : 4673,
"key" : "_shipping_phone",
"value" : "08 9632 7412"
}
]
So I'm performing a query and getting data back like this:
[
{ "part_number": "MAC0009", "description": "Accessory Stand Foot" },
{ "part_number": "MAC0010", "description": "Accessory Stand Collar Tapped M5" },
{ "part_number": "MAC0011", "description": "Accessory Stand Top Collar" },
{ "part_number": "MAC0012", "description": "25mm Round Knob With 2 Rail Holes" }
]
However for the AJAX script I'm trying to implement I need the data in this format:
[
{ "MAC0009" : "Accessory Stand Foot" },
{ "MAC00010" : "Accessory Stand Collar Tapped M5" },
{ "MAC00012" : "Accessory Stand Top Collar" }
]
So basically I need plain data back without the table names.
All I have so far is the query.
$result = DB::table('macs')->select('part_number', 'description')->get();
Which is obviously fine but I don't know how to manipulate the data into that format :/ Any help appreciated.
You can use lists method:
DB::table('macs')->select('part_number', 'description')->lists('description', 'part_number');
I am trying to develop a web application that can fetch data from Asana and generate custom spreadsheet reports. This wrapper class was very helpful in making things simple.
However, I am having a hard time in writing code that gets me the team/s that a particular task belongs to. Even when I export data as JSON through Asana's web application the 'teams' find no mention. From what I understand, Asana itself does not provide an association between teams and tasks. Please correct me if I am wrong.
But if I am right at my conclusion, is there a workaround I could use? Teams are an important part of my data rendering and I need them to be mapped correctly in my reports that I am trying to generate from Asana. The report I want to generate would be hierarchical in nature.
Organisation
Team
Projects
Tasks
Subtask
Can I do something to achieve this hierarchy? The only place I get stuck is getting the projects under a particular team.
Glad to hear that you found that wrapper useful. We will be releasing a PHP Library ourselves soon that you may be interested in. Stay tuned!
Below is some pseudo-code to derive the hierarchy you are looking for, I think. Let me know if it helps.
GET /workspaces
{
"data": [
{
"id": 1234,
"name": "Startup Inc"
}
]
}
GET /workspaces/1234
{
"data": {
"id": 1234,
"name": "Startup Inc",
"is_organization": true,
...
}
}
Because is_corganization is true, we can then continue...
GET /organizations/organization-id/teams
{
"data": [
{
"id": 9876,
"name": "Ninja Team"
}
]
}
GET /teams/9876/projects
{
"data": [
{
"id": 5678,
"name": "Stealth Project"
}
]
}
GET /projects/5678/tasks
{
"data": [
{
"id": 8675309,
"name": "Top secret video"
}
]
}
GET /tasks/8675309
{
"data": {
"id": 8675309,
"created_at": "2015-03-25T17:28:59.255Z",
"modified_at": "2015-05-15T03:13:28.754Z",
"name": "Top secret video",
"notes": "https://www.youtube.com/watch?v=6WTdTwcmxyo",
"completed": false,
... # All the task data
]
}
}