Related
Does somebody knows why Twitter API delivers different information for the same status using different methods?
I'm working on a Twitter bot to collect transit events. I'm facing some issues with the information delivered by the API, due to I've identified that depending on the method, the API can deliver different result for the same Tweet/status.
Here an example for the Tweet ID:1531517617562951682 using api.get_status, the status doesn't have the attributes extended_tweet and timestamp_ms.
Thanks in advance.
{
"created_at": "Tue May 31 06:07:08 +0000 2022",
"id": 1531517617562951682,
"id_str": "**1531517617562951682**",
"text": "01:07 #Precauci\u00f3nVial | Por percance en Av. Ing. Eduardo Molina a la altura de Av. Talism\u00e1n, col. San Pedro el Chic\u2026 (**removed_url)",
**"truncated": true**,
"entities": {
"hashtags": [
{
"text": "Precauci\u00f3nVial",
"indices": [
6,
21
]
}
],
"symbols": [],
"user_mentions": [],
"urls": [
{
"url": **removed_url_short,
"expanded_url": ,
"display_url": ,
"indices": [
117,
140
]
}
]
},
"source": "Twitter Web App",
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 166594238,
"id_str": "166594238",
"name": "OVIAL_SSCCDMX",
"screen_name": "OVIALCDMX",
"location": "Liverpool #136, Col. Ju\u00e1rez",
"description": "Centro de Orientaci\u00f3n Vial de la Secretar\u00eda de Seguridad Ciudadana de la Ciudad de M\u00e9xico.",
"url":,
"entities": {
"url": {
"urls": [
{
"url": ,
"expanded_url": ,
"display_url": "ssc.cdmx.gob.mx",
"indices": [
0,
23
]
}
]
},
"description": {
"urls": []
}
},
"protected": false,
"followers_count": 1866313,
"friends_count": 125,
"listed_count": 4188,
"created_at": "Wed Jul 14 15:00:43 +0000 2010",
"favourites_count": 2748,
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"verified": true,
"statuses_count": 1110675,
"lang": null,
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "000000",
"profile_background_image_url":
"profile_background_image_url_https": ,
"profile_background_tile": false,
"profile_image_url": ,
"profile_image_url_https": ,
"profile_banner_url": ,
"profile_link_color": "BC8F8F",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "000000",
"profile_text_color": "000000",
"profile_use_background_image": false,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": false,
"follow_request_sent": false,
"notifications": false,
"translator_type": "none",
"withheld_in_countries": []
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 0,
"favorite_count": 0,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"possibly_sensitive_appealable": false,
"lang": "es"
}
Same status collected with a stream.Attributes extended_tweet and timestamp are present on the status:
{
"created_at": "Tue May 31 06:07:08 +0000 2022",
"id": 1531517617562951682,
"id_str": "1531517617562951682",
"text": "01:07 #Precauci\u00f3nVial | Por percance en Av. Ing. Eduardo Molina a la altura de Av. Talism\u00e1n, col. San Pedro el Chic\u2026 (**removed url)",
"display_text_range": [
0,
140
],
"source": "Twitter Web App",
"truncated": true,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 166594238,
"id_str": "166594238",
"name": "OVIAL_SSCCDMX",
"screen_name": "OVIALCDMX",
"location": "Liverpool #136, Col. Ju\u00e1rez",
"url": "http://ssc.cdmx.gob.mx",
"description": "Centro de Orientaci\u00f3n Vial de la Secretar\u00eda de Seguridad Ciudadana de la Ciudad de M\u00e9xico.",
"translator_type": "none",
"protected": false,
"verified": true,
"followers_count": 1866203,
"friends_count": 125,
"listed_count": 4188,
"favourites_count": 2748,
"statuses_count": 1110325,
"created_at": "Wed Jul 14 15:00:43 +0000 2010",
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"lang": null,
"contributors_enabled": false,
"is_translator": false,
"profile_background_color": "000000",
"profile_background_image_url": ,
"profile_background_image_url_https": ,
"profile_background_tile": false,
"profile_link_color": "BC8F8F",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "000000",
"profile_text_color": "000000",
"profile_use_background_image": false,
"profile_image_url": ,
"profile_image_url_https": ,
"profile_banner_url": ,
"default_profile": false,
"default_profile_image": false,
"following": null,
"follow_request_sent": null,
"notifications": null,
"withheld_in_countries": []
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"extended_tweet": {
"full_text": "01:07 #Precauci\u00f3nVial | Por percance en Av. Ing. Eduardo Molina a la altura de Av. Talism\u00e1n, col. San Pedro el Chico, servicios de emergencia acuden al lugar. (**removed url)",
"display_text_range": [
0,
158
],
"entities": {
"hashtags": [
{
"text": "Precauci\u00f3nVial",
"indices": [
6,
21
]
}
],
"urls": [],
"user_mentions": [],
"symbols": [],
"media": [
{
"id": 1531517217703092224,
"id_str": "1531517217703092224",
"indices": [
159,
182
],
"additional_media_info": {
"monetizable": false
},
"media_url": ,
"media_url_https": ,
"url":,
"display_url": "pic.twitter.com/q3seKvyPIM",
"expanded_url": ,
"type": "video",
"video_info": {
"aspect_ratio": [
16,
9
],
"duration_millis": 4003,
"variants": [
{
"content_type": "application/x-mpegURL",
"url": ""
},
{
"bitrate": 832000,
"content_type": "video/mp4",
"url": "
},
{
"bitrate": 256000,
"content_type": "video/mp4",
"url":
}
]
},
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"large": {
"w": 640,
"h": 360,
"resize": "fit"
},
"medium": {
"w": 640,
"h": 360,
"resize": "fit"
},
"small": {
"w": 640,
"h": 360,
"resize": "fit"
}
}
}
]
},
"extended_entities": {
"media": [
{
"id": 1531517217703092224,
"id_str": "1531517217703092224",
"indices": [
159,
182
],
"additional_media_info": {
"monetizable": false
},
"media_url": ,
"media_url_https": ,
"url": ,
"display_url": ,
"expanded_url": ,
"type": "video",
"video_info": {
"aspect_ratio": [
16,
9
],
"duration_millis": 4003,
"variants": [
{
"content_type": "application/x-mpegURL",
"url": "
},
{
"bitrate": 832000,
"content_type": "video/mp4",
"url": "
},
{
"bitrate": 256000,
"content_type": "video/mp4",
"url": ""
}
]
},
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"large": {
"w": 640,
"h": 360,
"resize": "fit"
},
"medium": {
"w": 640,
"h": 360,
"resize": "fit"
},
"small": {
"w": 640,
"h": 360,
"resize": "fit"
}
}
}
]
}
},
"quote_count": 0,
"reply_count": 0,
"retweet_count": 0,
"favorite_count": 0,
"entities": {
"hashtags": [
{
"text": "Precauci\u00f3nVial",
"indices": [
6,
21
]
}
],
"urls": [
{
"url": ,
"expanded_url": ,
"display_url": "twitter.com/i/web/status/1\u2026",
"indices": [
117,
140
]
}
],
"user_mentions": [],
"symbols": []
},
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"filter_level": "low",
"lang": "es",
"**timestamp_ms**": "1653977228905"
}
For v1.1, the extended Tweet information is available by default in the streaming API, but for the REST endpoints, you need to add the tweet_mode=extended parameter to your request to retrieve the full text.
In V2, there is no longer a concept of extended (beyond 140 characters) Tweets. All Tweets are natively up to 280 characters as standard.
Campaign:
{
"id": "1709932214",
"name": "Noah Baumbach",
"status": "ENABLED",
"servingStatus": "PENDING",
"startDate": "20190219",
"endDate": "20190220",
"budget": {
"budgetId": "1730787529",
"name": "Dominic Schumm",
"amount": {
"ComparableValue.Type": "Money",
"microAmount": "10000"
},
"deliveryMethod": "STANDARD",
"referenceCount": 5,
"isExplicitlyShared": true,
"status": "ENABLED"
},
"conversionOptimizerEligibility": {
"eligible": false,
"rejectionReasons": [
"CONVERSION_TRACKING_NOT_ENABLED"
]
},
"adServingOptimizationStatus": "OPTIMIZE",
"frequencyCap": {
"impressions": "100",
"timeUnit": "DAY",
"level": "CAMPAIGN"
},
"settings": [
{
"attributes": {
"xsi:type": "GeoTargetTypeSetting"
},
"Setting.Type": "GeoTargetTypeSetting",
"positiveGeoTargetType": "DONT_CARE",
"negativeGeoTargetType": "DONT_CARE"
}
],
"advertisingChannelType": "DISPLAY",
"networkSetting": {
"targetGoogleSearch": false,
"targetSearchNetwork": false,
"targetContentNetwork": true,
"targetPartnerSearchNetwork": false
},
"biddingStrategyConfiguration": {
"biddingStrategyType": "MANUAL_CPC"
},
"campaignTrialType": "BASE",
"baseCampaignId": "1709932214"
}
When I try to create ad group with below parameters:
{
campaignId: 1709932214,
name: 'Jess Hegmann',
status: 'ENABLED',
criterionTypeGroup: 'VERTICAL',
targetAll: false,
bidAmount: 10000,
biddingStrategyType: 'MANUAL_CPC',
biddingStrategyName: 'biddingName 123',
adGroupType: 'DISPLAY_STANDARD',
adGroupAdRotationMode: 'OPTIMIZE',
};
Google adwords give me an error:
Failed: "[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE # operations[0].operand.biddingStrategyConfiguration.biddingStrategyType; trigger:'DISPLAY']"
How can I solve this?
I think this might be the reason:
Starting with v201705, this field cannot be set at the ad group or ad group criterion level to any value other than BiddingStrategyType.NONE.
Bid Strategy AdGroup Google Ads
I am using iOS custom URL scheme and i want to create a route in sygic app. As mentioned on their documentation to load a json (.sif) itinerary, I am using their custom URL scheme
com.sygic.aura://route%7Cmyitinerary.sif
to load my .sif file.
{
"name": "test",
"version": "2.2",
"directives": {
"allowItineraryEdit": true
},
"routeParts": [{
"properties": {
"routeMappingType": "none",
"precomputed": false,
"map": "NT:2017.09"
},
"waypointFrom": {
"lon": -315442,
"lat": 5149939,
"lonNavi": -315442,
"latNavi": 5149939,
"type": "start",
"waypointId": -1,
"hitRadius": 50,
"hitSpeed": 50,
"caption": "Barons Court Road 21/34, Cardiff, Penylan",
"realtimeStatus": {
"status": "visited",
"estimatedTimeArrival": "2018-04-17T13:08:15Z",
"timeRemaining": 0,
"distanceRemaining": 0,
"edited": false
}
},
"waypointTo": {
"lon": -312245,
"lat": 5151827,
"lonNavi": -312245,
"latNavi": 5151827,
"type": "via",
"waypointId": -1,
"hitRadius": 50,
"hitSpeed": 50,
"caption": "Llanrumney Avenue 193/218, Cardiff, Llanrumney",
"realtimeStatus": {
"status": "unvisited",
"estimatedTimeArrival": "2018-04-17T13:19:34Z",
"timeRemaining": 679,
"distanceRemaining": 4214,
"edited": false
}
}
}, {
"properties": {
"routeMappingType": "none",
"precomputed": false,
"map": "NT:2017.09"
},
"waypointFrom": {
"lon": -312245,
"lat": 5151827,
"lonNavi": -312245,
"latNavi": 5151827,
"type": "via",
"waypointId": -1,
"hitRadius": 50,
"hitSpeed": 50,
"caption": "Llanrumney Avenue 193/218, Cardiff, Llanrumney",
"realtimeStatus": {
"status": "unvisited",
"estimatedTimeArrival": "2018-04-17T13:19:34Z",
"timeRemaining": 679,
"distanceRemaining": 4214,
"edited": false
}
},
"waypointTo": {
"lon": -314670,
"lat": 5152479,
"lonNavi": -314670,
"latNavi": 5152479,
"type": "finish",
"waypointId": -1,
"hitRadius": 50,
"hitSpeed": 50,
"caption": "Pentwyn, United Kingdom",
"realtimeStatus": {
"status": "unvisited",
"estimatedTimeArrival": "2018-04-17T13:29:51Z",
"timeRemaining": 1296,
"distanceRemaining": 10859,
"edited": false
}
}
}]
}
The app is triggered and its opened. But i am getting an wierd message as in the screenshot.
Can anyone help me why i am getting this issue please ?
The issue is with the documentation, because this custom url is not working for iOS just for Android application, due to file access limitation on iOS. The only workaround is to use com.sygic.aura://route_download | url (sif or json) and upload this itinerary file somewhere (is should be https server, because Apple is limiting apps to secure limitation only)
I'm grabbing some information about the user's screen resolutions and screen setup.
electron.desktopCapturer.getSources() returns DesktopCapturerSource[] which I use to get a thumbnail of the screen.
electron.screen.getAllDisplays() returns Display[] which I use to get the screen dimensions, rotation, etc.
Both are arrays of equal size, wherein each element represents different information about the desktop screen. They have names and ids, neither of which seem to match up between the objects. I'm unsure of how exactly I can correlate the data between the two objects to guarantee I am talking about the same screen.
You can join both of the calls and correspond id from the objects returned by screen.getAllDisplays() with display_id from the objects returned by desktopCapturer.getSources().
Please note that this was tried on MacOS Big Sur with Electron 12 and that the results may not be the same with other operating systems.
Example output from screen.getAllDisplays():
[
{
id: 2077748985,
bounds: { x: 0, y: 0, width: 1792, height: 1120 },
workArea: { x: 0, y: 25, width: 1792, height: 1095 },
accelerometerSupport: 'unknown',
monochrome: false,
colorDepth: 30,
colorSpace: '{primaries:BT709, transfer:IEC61966_2_1_HDR, matrix:RGB, range:FULL}',
depthPerComponent: 10,
size: { width: 1792, height: 1120 },
displayFrequency: 59,
workAreaSize: { width: 1792, height: 1095 },
scaleFactor: 2,
rotation: 0,
internal: true,
touchSupport: 'unknown'
}
]
Example output from desktopCapturer.getSources():
[
{
"name": "Entire Screen",
"id": "screen:2077748985:0",
"thumbnail": {
"isMacTemplateImage": false
},
"display_id": "2077748985",
"appIcon": null
},
{
"name": "Hello World!",
"id": "window:33637:0",
"thumbnail": {
"isMacTemplateImage": false
},
"display_id": "",
"appIcon": null
},
{
"name": "Hello World!",
"id": "window:33636:0",
"thumbnail": {
"isMacTemplateImage": false
},
"display_id": "",
"appIcon": null
},
{
"name": "Correlating the screen information from electron.desktopCapturer.getSources() and electron.screen.getAllDisplays() - Stack Overflow",
"id": "window:3257:0",
"thumbnail": {
"isMacTemplateImage": false
},
"display_id": "",
"appIcon": null
},
{
"name": "electron-fun — Electron Helper (Renderer) ◂ npm TERM_PROGRAM=Apple_Terminal SHELL=/bin/zsh — 127×68",
"id": "window:32731:0",
"thumbnail": {
"isMacTemplateImage": false
},
"display_id": "",
"appIcon": null
},
{
"name": "Calculator",
"id": "window:32797:0",
"thumbnail": {
"isMacTemplateImage": false
},
"display_id": "",
"appIcon": null
}
]
Note that id is: 2077748985 and display_id is also: 2077748985.
as a noob in groovy/grails , i'd like to learn how to make or use a plugin for charts .
i tried zing chart , tried the exemples , but nothing as a result , sometimes i have the area of the chart and nothing else.
So to display the chart i used zing :
<zing:chart type="area" width="700" height="350" container="acceptToConvertChart" data="${data}" xLabels="${labels}" effect="4" />
And for the script :
<script> def labels = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
def data = [
'Visitors': [100, 300, 200, 240, 500, 100, 80],
'Purchases': [30, 50, 12, 20, 55, 20, 10]
]</script>
when i use it , nothing hapen , the area just disapear
for include :
<zing:include/>
and it's underlined in yellow like every thing that's in relation with zing chart and when i hover it ,it says that zing is unknown , so what i should do?
Please help .
When you explain ,just know that i am not java developper .
Thank you in advance.
you need something like this in your HTML:
<head>
<script src= "https://cdn.zingchart.com/zingchart.min.js"></script>
<script> zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";
ZC.LICENSE =["569d52cefae586f634c54f86dc99e6a9","ee6b7db5b51705a13dc2339db3edaf6d"]; </script>
</head>
<body>
Here is your ZingChart:
<div id='myChart'></div>
</body>
and something like this javascript:
zingchart.THEME = "classic";
var myConfig =
{
"type": "area",
"background-color": "#fff",
"stacked": false,
"title": {
"text": "Visitors & Sales",
"background-color": "#fff",
"font-color": "#05636c",
"adjust-layout":true
},
"tooltip": {
"visible": false
},
"plot": {
"aspect": "stepped",
"line-width": "1px",
"marker": {
"visible": false
},
"hover-state": {
"visible": false
},
"shadow": false
},
"plotarea": {
"margin": "dynamic"
},
"scale-x": {
"values": [
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
],
"line-color": "#000",
"line-width": "1px",
"guide": {
"visible": false
},
"tick": {
"line-color": "#000",
"line-width": "1px"
},
"label": {
"text": "Days of the Week",
"font-size": "14px",
"font-family": "helvetica",
"font-weight": "normal",
"offset-y": "5%",
"font-color":"#05636c"
},
"item": {
"font-color": "#05636c",
"font-weight": "normal",
"font-family": "helvetica",
"font-size": "12px",
"offset-y": "3%"
}
},
"scale-y": {
"values": "0:600:50",
"line-color": "#000",
"line-width": "1px",
"tick": {
"line-color": "#000",
"line-width": "1px"
},
"label": {
"text": "Volume",
"font-size": "14px",
"font-family": "helvetica",
"font-weight": "normal",
"font-color":"#05636c"
},
"item": {
"font-color": "#05636c",
"font-weight": "normal",
"font-family": "helvetica",
"font-size": "12px",
"offset-x": "-5%"
},
"guide": {
"visible": false
}
},
"crosshair-x": {
"line-color": "#ffffff",
"marker": {
"visible": false
},
"plot-label": {
"text": "<strong>%v</strong> %t",
"shadow": 0,
"font-size": "12px",
"font-color": "#05636c",
"font-family": "helvetica",
"border-width": "1px",
"border-color": "#05636c",
"background-color": "#ffffff",
"text-align": "center"
},
"scale-label": {
"font-size": "12px",
"font-color": "#000000",
"font-family": "helvetica",
"background-color": "#ffffff",
"offset-y": "3%"
}
},
"series": [
{
"values": [
30, 50, 12, 20, 55, 20, 10
]
},
{
"values": [
100, 300, 200, 240, 500, 100, 80]
}
]
};
zingchart.render({
id : 'myChart',
data : myConfig,
height: 300,
width: 500
});
please take a look at this working example
note that you will probably have for populate the section
"values": [
30, 50, 12, 20, 55, 20, 10
]
with your actual values coming from your grails controller