Google+ article rendering no longer working after adding JSON-LD Schema.org - google-plus

I recently updated my blog to use JSON-LD to add Schema.org data to the site. However, I've run into a problem - Google+ article rendering is no longer working.
When I try to share a link from my blog to my Google+ page, it loads the article image, but not the article headline. Article rendering was working fine before when I was relying solely on the Open Graph protocol.
I've run my JSON-LD code through Google's Structured Data Testing Tool and it doesn't report any errors or warnings. No errors are being reported in Google Webmaster Tools either.
Am I overlooking something or doing something wrong?
For reference, here is the most recent blog post I tried to share when I noticed the article headline wasn't loading in:
https://onemoredram.com/2018/07/27/diageo-releasing-trio-of-new-mortlach-expressions/

I've ran your JSON-LD through a test; there are two errors actually:
WARNING: the "July 27, 2018" value in the http://schema.org/datePublished field is not a valid date. Dates should be in the ISO 8601 format
ERROR: the validator does not recognize the article prefix, please specify it clearly in the prefix attribute
The full result of the test was:
rdfanode
http://ogp.me/ns#title
#value = Diageo Releasing Trio of New Mortlach Expressions | One More Dram
http://ogp.me/ns#type
#value = article
http://ogp.me/ns#url
#value = https://onemoredram.com/2018/07/27/diageo-releasing-trio-of-new-mortlach-expressions/
http://ogp.me/ns#image
http://ogp.me/ns#image:width
#value = 960
http://ogp.me/ns#image:height
#value = 664
#value = https://onemoredram.com/wp-content/uploads/2018/07/mortlach-12-16-20-year-old-07-27-2018.jpg
http://ogp.me/ns#site_name
#value = One More Dram
http://ogp.me/ns/fb#admins
#value = 571973782956119
http://ogp.me/ns#description
#value = Diageo is releasing a trio of new Mortlach expressions: 12 Year Old The Wee Witchie, 16 Year Old Distiller's Dram, and 20 Year Old Cowie's B...
http://dev.twitter.com/cards/markup#card
#value = summary_large_image
http://dev.twitter.com/cards/markup#site
#value = #1moredram
http://dev.twitter.com/cards/markup#domain
#value = onemoredram.com
http://dev.twitter.com/cards/markup#title
#value = Diageo Releasing Trio of New Mortlach Expressions | One More Dram
http://dev.twitter.com/cards/markup#description
#value = Diageo is releasing a trio of new Mortlach expressions: 12 Year Old The Wee Witchie, 16 Year Old Distiller's Dram, and 20 Year Old Cowie's B...
http://dev.twitter.com/cards/markup#image
#value = https://onemoredram.com/wp-content/uploads/2018/07/mortlach-12-16-20-year-old-07-27-2018.jpg
jsonld
#type = http://schema.org/Organization
http://schema.org/name
#value = One More Dram
http://schema.org/url
#id = https://onemoredram.com
http://schema.org/logo
#id = https://onemoredram.com/wp-content/themes/onemoredram/images/og-default-image.jpg
http://schema.org/sameAs
#id = https://www.facebook.com/onemoredram
http://schema.org/sameAs
#id = https://plus.google.com/+onemoredram
http://schema.org/sameAs
#id = https://www.instagram.com/onemoredram
http://schema.org/sameAs
#id = https://www.patreon.com/onemoredram
http://schema.org/sameAs
#id = https://www.twitter.com/1moredram
http://schema.org/sameAs
#id = https://www.youtube.com/onemoredram
jsonld
WARNING: the "July 27, 2018" value in the http://schema.org/datePublished field is not a valid date. Dates should be in the ISO 8601 format
#type = http://schema.org/NewsArticle
http://schema.org/mainEntityOfPage
#type = http://schema.org/WebPage
#id = https://onemoredram.com/2018/07/27/diageo-releasing-trio-of-new-mortlach-expressions/
http://schema.org/headline
#value = Diageo Releasing Trio of New Mortlach Expressions
http://schema.org/description
#value = Diageo is releasing a trio of new Mortlach expressions: 12 Year Old The Wee Witchie, 16 Year Old Distiller’s Dram, and 20 Year Old Cowie’s Blue Seal.
http://schema.org/image
#id = https://onemoredram.com/wp-content/uploads/2018/07/mortlach-12-16-20-year-old-07-27-2018.jpg
http://schema.org/datePublished
#value = July 27, 2018
#type = http://Date
http://schema.org/dateModified
#value = July 27, 2018
#type = http://Date
http://schema.org/author
#type = http://schema.org/Person
http://schema.org/name
#value = Elias Aoude
http://schema.org/publisher
#type = http://schema.org/Organization
http://schema.org/name
#value = One More Dram
http://schema.org/logo
#type = http://schema.org/ImageObject
http://schema.org/url
#id = https://onemoredram.com/wp-content/themes/onemoredram/images/og-default-image.jpg
rdfanode
ERROR: the validator does not recognize the article prefix, please specify it clearly in the prefix attribute
resource = https://onemoredram.com/2018/07/27/diageo-releasing-trio-of-new-mortlach-expressions/
http://www.w3.org/1999/xhtml/vocab#alternate = https://onemoredram.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fonemoredram.com%2F2018%2F07%2F27%2Fdiageo-releasing-trio-of-new-mortlach-expressions%2F
http://www.w3.org/1999/xhtml/vocab#prev = https://onemoredram.com/2018/07/26/johnnie-walker-launching-blue-label-ghost-and-rare-port-ellen/
article:published_time = 2018-07-27T11:30:24Z
https://api.w.org/ = https://onemoredram.com/wp-json/
http://www.w3.org/1999/xhtml/vocab#alternate = https://onemoredram.com/2018/07/27/diageo-releasing-trio-of-new-mortlach-expressions/feed/
article:modified_time = 2018-07-27T18:05:48Z
http://www.w3.org/1999/xhtml/vocab#alternate = https://onemoredram.com/feed/
http://www.w3.org/1999/xhtml/vocab#alternate = https://onemoredram.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fonemoredram.com%2F2018%2F07%2F27%2Fdiageo-releasing-trio-of-new-mortlach-expressions%2F&format=xml
http://www.w3.org/1999/xhtml/vocab#alternate = https://onemoredram.com/comments/feed/
rdfanode
resource = https://onemoredram.com/2018/07/27/diageo-releasing-trio-of-new-mortlach-expressions/
http://www.w3.org/1999/xhtml/vocab#role = http://www.w3.org/1999/xhtml/vocab#search
I don't believe Google to be so strict (warning wise) however errors may cause issues where displaying your data properly would incur; I would try and correct these little things incase they are a factor.
This is a sample of the proper schema template (you either have seen this, or can use this to try and troubleshoot your schema):
<script type="application/ld+json">
{ "#context": "http://schema.org",
"#type": "BlogPosting",
"headline": "14 Ways Json Can Improve Your SEO",
"alternativeHeadline": "and the women who love them",
"image": "http://example.com/image.jpg",
"award": "Best article ever written",
"editor": "John Doe",
"genre": "search engine optimization",
"keywords": "seo sales b2b",
"wordcount": "1120",
"publisher": "Book Publisher Inc",
"url": "http://www.example.com",
"datePublished": "2015-09-20",
"dateCreated": "2015-09-20",
"dateModified": "2015-09-20",
"description": "We love to do stuff to help people and stuff",
"articleBody": "You can paste your entire post in here, and yes it can get really really long.",
"author": {
"#type": "Person",
"name": "Steve"
}
}
</script>
Hope it leads you in the proper direction :)

Related

GameMaker 2: Cannot use function/script name for a variable, using "_dir"

after going through the Space Mods - GML - Enemy Factions (2/3) - GameMaker Studio 2 tutorial on YouTube by Gamemaker.
I've came into some trouble with testing the game.
My compile error goes like this:
Script:create_bullet at line 6; cannot use function/script name for a variable, using "_dir"
The script in question:
/// #description create_bullet
/// #arg direction
/// #arg speed
/// #arg faction
function create_bullet(_dir,_spd,_fac,_creator){
var _dir = argument[0];
var _spd = argument[1];
var _fac = argument[2];
var _creator = self;
audio_play_sound(snd_zap, 1, false);
var inst = instance_create_layer(x,y, "Instances", obj_bullet);
with(inst){
direction = _dir();
speed = _spd;
faction = _fac;
creator = _creator;
if(faction == factions.ally) image_blend = c_aqua;
else if(faction == factions.enemy) image_blend = c_red;
}
}
I've checked the comments to see if anyone else has had a similar problem and I can't find the solution myself. Will anyone be able to help and explain. I'm quite new to coding and just taking it step by step.
I found an answer in another forum.
My mistake seems to have been placing brackets after _dir;:
with(inst){
direction = _dir(); <=
speed = _spd;
faction = _fac;
creator = _creator;
After removing that and taking out the var before:
_dir = argument[0];
_spd = argument[1];
_fac = argument[2];
_creator = self;
It seems to work fine now.

How to scrape a data table that has multiple pages using selenium?

I'm extracting NBA stats from my yahoo fantasy account. Below is the code that I made in jupyter notebook using selenium. Each page shows 25 players and a total of 720 players. I did a for loop that will scrape players in increments of 25 instead of one by one.
for k in range (0,725,25):
Players = driver.find_elements_by_xpath('//tbody/tr/td[2]/div/div/div/div/a')
Team_Position = driver.find_elements_by_xpath('//span[#class= "Fz-xxs"]')
Games_Played = driver.find_elements_by_xpath('//tbody/tr/td[7]/div')
Minutes_Played = driver.find_elements_by_xpath('//tbody/tr/td[11]/div')
FGM_A = driver.find_elements_by_xpath('//tbody/tr/td[12]/div')
FTM_A = driver.find_elements_by_xpath('//tbody/tr/td[14]/div')
Three_Points = driver.find_elements_by_xpath('//tbody/tr/td[16]/div')
PTS = driver.find_elements_by_xpath('//tbody/tr/td[17]/div')
REB = driver.find_elements_by_xpath('//tbody/tr/td[18]/div')
AST = driver.find_elements_by_xpath('//tbody/tr/td[19]/div')
ST = driver.find_elements_by_xpath('//tbody/tr/td[20]/div')
BLK = driver.find_elements_by_xpath('//tbody/tr/td[21]/div')
TO = driver.find_elements_by_xpath('//tbody/tr/td[22]/div')
NBA_Stats = []
for i in range(len(Players)):
players_stats = {'Name': Players[i].text,
'Position': Team_Position[i].text,
'GP': Games_Played[i].text,
'MP': Minutes_Played[i].text,
'FGM/A': FGM_A[i].text,
'FTM/A': FTM_A[i].text,
'3PTS': Three_Points[i].text,
'PTS': PTS[i].text,
'REB': REB[i].text,
'AST': AST[i].text,
'ST': ST[i].text,
'BLK': BLK[i].text,
'TO': TO[i].text}
driver.get('https://basketball.fantasysports.yahoo.com/nba/28951/players?status=ALL&pos=P&cut_type=33&stat1=S_AS_2021&myteam=0&sort=AR&sdir=1&count=' + str(k))
The browser will go page by page after it's done. I print out the results. It only scrape 1 player. What did I do wrong?
A picture of my codes and printing the results
It's hard to see what the issue here is without looking at the original page (can you provide a URL?), however looking at this:
next = driver.find_element_by_xpath('//a[#id = "yui_3_18_1_1_1636840807382_2187"]')
"1636840807382" looks like a Javascript timestamp, so I would guess that the reference you've got hardcoded there is dynamically generated, so the element "yui_3_18_1_1_1636840807382_2187" no longer exists.

Prestashop - Calling categories api results in error

I have to fetch data from a prestashop, and it has worked until now. They have upgraded their prestashop but haven't given me more details.
When I call: https://realshopname/api/categories?display=full&limit=0,50
which works fine on other prestashop installations and also this one, before they made an update. Now I get the following error
PHP Warning #2] Declaration of Product::addAttribute($price, $weight,
$unit_impact, $ecotax, $id_images, $reference, $delivery_label,
$ean13, $default, $location = NULL, $upc = NULL, $minimal_quantity =
1, array $id_shop_list = Array, $available_date = NULL, $quantity = 0,
$isbn = '', $low_stock_threshold = NULL, $low_stock_alert = false)
should be compatible with ProductCore::addAttribute($price, $weight,
$unit_impact, $ecotax, $id_images, $reference, $ean13, $default,
$location = NULL, $upc = NULL, $minimal_quantity = 1, array
$id_shop_list = Array, $available_date = NULL, $quantity = 0, $isbn =
'', $low_stock_threshold = NULL, $low_stock_alert = false)
(/var/www/realshopname/public_html/override/classes/Product.php, line
0)"
As far as I guess, the error is on their shop, but how can I help the shop in figuring out what is wrong.
The issue appears to come because there is an override file (probably needed by some module to extend core functionalities) :
/var/www/realshopname/public_html/override/classes/Product.php
that conflicts with webservices.
Have an inspection on this file, you'll probably find in a comment the module that uses this override. Then check if module is still needed , in this case an update is required to make it compliant with new version. Otherwise uninstall the module and you should be all set.

Linqpad extension to plot graphs

I tried to plot some graphs in Linqpad with with "Util.RawHtml()" and "Dump()" but it is not working with this example from amcharts.com. I created a string variable including all the HTML source code but the result is not working.
string html = "";
using (System.Net.WebClient client = new System.Net.WebClient ())
{
html = client.DownloadString(#"http://pastebin.com/raw/pmMMwXhm");
}
Util.RawHtml(html).Dump();
Later versions of LinqPad 5 now support charting out of the box with Util.Chart. You can see the samples in the Samples Tab (next to My Queries) under
LINQPad Tutorial&Reference
Scratchpad Features
Charting with Chart
The following script is the Chart() - dual scale sample:
// Each y-series can have a different series type, and can be assigned to the secondary y-axis scale on the right.
var customers = new[]
{
new { Name = "John", TotalOrders = 1000, PendingOrders = 50, CanceledOrders = 20 },
new { Name = "Mary", TotalOrders = 1300, PendingOrders = 70, CanceledOrders = 25 },
new { Name = "Sara", TotalOrders = 1400, PendingOrders = 60, CanceledOrders = 17 },
};
customers.Chart (c => c.Name)
.AddYSeries (c => c.TotalOrders, Util.SeriesType.Spline, "Total")
.AddYSeries (c => c.PendingOrders, Util.SeriesType.Column, "Pending", useSecondaryYAxis:true)
.AddYSeries (c => c.CanceledOrders, Util.SeriesType.Column, "Cancelled", useSecondaryYAxis:true)
.Dump();
As I understand it, this will not work because the html contains scripts that will not be executed.
As an alternative, you can still use the old (and deprecated) google charts api, eg
var link = #"http://chart.apis.google.com/chart?chxt=y&chbh=a&chs=300x225&cht=bvg&chco=A2C180,3D7930&chd=t:10,20,30,40,50,60|30,35,40,45,55,60&chtt=Sample";
Util.Image (link).Dump();
or see
http://blog.divebomb.org/2012/11/dumping-charts-in-linqpad/
Not sure if it's the answer you're after but there may be value in looking at the DisplayWebPage method on the Util class in Linqpad. This correctly rendered your chart in the result window, (although there was a script error). Obviously, this may not solve your underlying issue.
I used version 5.10.00 to test this.

Integration Quickbook online api to rails app

I am integrating
rails application to Quickbooks online
using API.
Use gem Quickbooks-ruby
But want to add discount, add taxes into invoice but not success even not found how to pass in API.
invoice = Quickbooks::Model::Invoice.new
invoice.customer_id = 1
invoice.txn_date = Date.civil(2014, 3, 27)
invoice.doc_number = "001"
transaction_tax = Quickbooks::Model::TransactionTaxDetail.new
# Point to a saved tax code in QBO, e.g. this points to id = 2,
# which is a NYC tax code saved on QBO account = 10% sales tax
transaction_tax.txn_tax_code_id = 2
transaction_tax.total_tax = 134.10
invoice.txn_tax_detail = transaction_tax
sales_line_item = Quickbooks::Model::InvoiceLineItem.new
sales_line_item.amount = 1490
sales_line_item.description = "CCM ice skates"
sales_line_item.sales_item! do |detail|
detail.unit_price = 149
detail.quantity = 10
detail.item_id = 1 # Item ID here
detail.tax_code_id = 'TAX' # for US must be 'NON' or 'TAX'
end
discount_line_item = Quickbooks::Model::InvoiceLineItem.new
discount_line_item.amount = 149
discount_line_item.discount_item! do |detail|
detail.discount_percent = 10
detail.percent_based = true
detail.discount_account_id = 99
end
invoice.line_items << sales_line_item
invoice.line_items << discount_line_item
service = Quickbooks::Service::Invoice.new
service.access_token = OAuth::AccessToken.new($qb_oauth_consumer, "token", "secret")
service.company_id = "9991111222"
created_invoice = service.create(invoice)
There should be something like JAXB in ruby for object serialization/deserialization.
From the following link, you can download QB endpoint definations and data class defination(as XSD). You need to generate data classes from it.
https://developer.intuit.com/docs/#api/deki/files/2466/v3.1_dataservices.zip
Then using any standard ruby based OAuth lib, you can make call to QB API Endpoints.
You can use the setter methods of the data class( in your case - invoice ) to populate data/to construct the payload. ( I don't have any ready example of this. But I guess it is not hard to find in net)
For doc, you can refer the following two links.
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/invoice
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/invoice#DiscountLineDetail
Thanks