Irssi Config File Hilight Default Values Functionality For Text/Channel - config

I have the following in my irssi config:
hilights = (
{
text = "!starcraftsignal";
color = "%B";
actcolor = "%B";
},
{
actcolor = "%G";
channels = "#glass";
},
{
actcolor = "#Y";
channels = "#robots";
},
);
I use Putty to SSH and want the channels #robots and #glass to get highlighted in the channel overview strip at the bottom with numbers whenever a message is made in any of the channels I'm not in, and I want the same to happen when someone says !starcraftsignal irregardless of channel.
Currently my config isn't working. Do I need to specify the text field even for hilighting for any/all messages made and if so, what do I specify it to? Also do I need to list all the channels for !starcraftsignal or is the 'default' all channels I'm connected to?

Related

Elasticsearch not accepting size

So I have a search created with elasticsearch request within Vuejs that runs great and all works but as soon as I add any size/from parameters into the query I get the error "Options contains invalid key: size" but I'm unsure of where it's going wrong. I have tried changing it to a get and I have tried rebuilding the query in several different ways but keep getting the same result.
let buildURL = 'https://blahblahblah.com/search';
const article = { query: query.query,
size: 50
};
const headers = {
'Authorization':'$token',
'Content-Type':'application/json',
};
let querydata = await $axios.$post(buildURL, article, { headers });
Options contains invalid key is not an error coming out of Elasticsearch directly. The component you're interacting with is called App Search and is a search engine layer on top of Elasticsearch.
So, all you need to change is the following:
const article = { query: query.query,
page: { size: 50 } <---- change this line
};
That should do the trick
passing of param size index option not define
Or there might be another option to get size , might be limit 0,50
Share interface file

Check if number has whatsapp via whatsapp web

I know it's possible to create a button to start a conversation for a number.
But is it possible to check first if this number has whatsapp?
I need a grid with multiple numbers, and show the option to start conversation only for numbers that have whatsapp.
Note: I want to make this process logged in to whatsapp web.
It is a bit old question, but i get this question when i search for the same thing. After some reads, this is what i get. Hope it could help someone that search the same thing.
You could use the Client.getNumberId() function to check if the mobile phone number is registered on WhatsApp or not, check out the documentation on https://docs.wwebjs.dev/Client.html.
Note: you might need to sanitized the phone number first to ensure it is in the right format, which is , etc 618123456789.
61 is the country code, and the 08123456789 is the usual mobile number (remove the first zero on it).
var client = whatsAppWebClient.client;
var mobile_no = '628123456789';
// Get the registered WhatsApp ID for a number
var number_details = await client.getNumberId(sanitized_number);
if(number_details) {
console.log("Sending message to ", number_details);
/* send message */
} else {
console.log(sanitized_number, "Mobile no is not registered on
}
import {Client} from 'whatsapp-web.js';
const client = new Client({
// client configuration if any
})
// other blocks of code goes here
//function for checking if number is registered on whatsapp
const isNumberOnWhatsapp = async (number) => {
return await client.isRegisteredUser(number)
}
client.initialize()

IBM MobileFirst Detect Application Version Update

During version update, user will receive an update notification once he active the app, an update alert box will pop up, and he/she is able to choose "Update" or "Cancel" the update request.
How do I detect the action(Update/Cancel) user choose ?
If using the feature as provided by default in the product, you cannot.
In order to do such "detection", you will need to implement Custom Direct Update, but it doesn't sound like a full customization is needed in your case, so you can take a look at the following example under "customizing the UI": https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/advanced-client-side-development/using-direct-update-to-quickly-update-your-application/#userExprience
In the example code, there is additional code that either starts or cancels the update process, so it is this spot that you could add additional code to "know" that it was either started or canceled.
wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData,
directUpdateContext) {
// custom WL.SimpleDialog for Direct Update
var customDialogTitle = 'Custom Title Text';
var customDialogMessage = 'Custom Message Text';
var customButtonText1 = 'Update Application';
var customButtonText2 = 'Not Now';
WL.SimpleDialog.show(customDialogTitle, customDialogMessage,
[{
text : customButtonText1,
handler : function() {
directUpdateContext.start();
// Additional code here.
}
},
{
text : customButtonText2,
handler : function() {
wl_directUpdateChallengeHandler.submitFailure();
// Additional code here.
}
}]
);
};

Retrieve the traffic variable in RankedReport of Adobe Sitecatalyst

Is it possible to fetch a traffic variable sProp1 along with PageName and Url when issuing a GetReport request of a Ranked report?
Let us say I have the following passed to SiteCatalyst (Omniture) via Java Script.
s.pageName = o_title; // Page Name
s.channel = o_structure; // SiteSection
s.prop1 = o_inode // Traffic variable also the Primary Key Id of the PageName
Now, if I run a RankedReport, I will get the following
PageName
PageViews
Url
Along with this info, I will also be interested in fetching the s.prop1 value. I will need the s.prop1 value to use it on my db to query the first sentence of the article from db (and other metadata) and show the results on the results page that shows the most popular pages. Can this be achieved? I mean is it possible to get the traffic variable associated with the pageName?
Thanks,
Rag
OK. I think I if I add another element (prop1) I get the breakdown. {
"reportDescription":{
"reportSuiteID":"*",
"dateFrom":"2013-03-06",
"dateTo":"2013-03-15",
"metrics":[
{
"id":"pageviews",
"name":"Page Views",
"type":"number"
}
],
"sortBy":"pageviews",
"elements":[
{
"id":"siteSection"
},
{
"id":"page"
},
{
"id":"prop1"
}
],
"locale":"en_US"
},
"validate":"false"
}

Using Pusher to add markers on a map?

I am working to create a map to show based upon IP's of the people on my site. I was thinking a cool map showing all the places around the globe that were hitting the map. But I have come into a little issue. I have the ip's being tracked, and then from their they are processed in a Geo query, and finally I'm using pusherapp to post the data to the map. However, now I can make a unordered list, by appending the datato my site, but I can't figure out how to add it to my google map, nor have that map redraw with the data. Can someone help me here?
So basically on the server side:
var bounds = new google.maps.LatLngBounds();
var latlng = new google.maps.LatLng( #{#a.lat}, #{#a.lng});
var marker = new google.maps.Marker({
animation: google.maps.Animation.DROP,
icon: 'images/marker.png',
map: map,
position: latlng,
title: 'Here'
});
bounds.extend(latlng);
map.fitBounds(bounds);
followed by on the client side:
channel.bind('latitude', function(data){
$('#list').append(data);
});
But even if I do get it to plop into the script section is that google map going to know how to update?
I would really like to keep this all in Rails, and for the service I'm right now using pusher
Thanks!
thanks for using our service.
By the sounds of it you should be using our presence functionality so that you can keep track of users leaving and joining your site.
Part of the presence functionality is that when a user subscribes to a channel an AJAX call is made to your server. Within that call you can do your IP lookup and then return the details (I would suggest just the lat and long values) of that lookup as the user_info to the presence request. See Authenticating Users for more information on this. These docs also provide a Rails example of authenticating a user and providing user_info for that user.
When any user subscribes the the presence channel in the client they will get an initial list of connected users. You can loop through that user list and get the info for each user and add a marker to the Google map. When new users join you will get member_added events on the channel and you can add a new marker. When users leave you will get a member_removed event and you can remove a marker.
An example of the client code might be:
var channel = pusher.subscribe('presence-site-map-channel');
// Initial list of users on the site
channel.bind('pusher:subscription_succeeded', function(members) {
members.each(function(member) {
addMember(member);
});
});
channel.bind('pusher:member_added, addMember);
channel.bind('pusher:member_removed, function() { /* TODO: implement */});
function addMember(member) {
var bounds = new google.maps.LatLngBounds();
var latlng = new google.maps.LatLng( member.info.lat, member.info.long);
var marker = new google.maps.Marker({
animation: google.maps.Animation.DROP,
icon: 'images/marker.png',
map: map,
position: latlng,
title: member.info.id // each user must have a unique ID and you could use it here
});
bounds.extend(latlng);
map.fitBounds(bounds);
};