USPS API changes - calculator

I have a problem with the USPS shipping calculator.
It worked just fine until a few days back, when the international shipping rates suddenly stopped working. Also, the US domestic services contain now some strange characters.
After a few searches I managed to find that USPS changed its service names once again (it's crazy, they change their service names yearly or so).
My USPS calculator is from an older version of WP E-Commerce plugin, and I had to manually define which service types I want to allow for international quotes:
$allowed_types = array( 'First-Class Package International' => 'First-Class Package International Service<sup>™</sup>**');
I guess since the name changed the $allowed_types variable doesn't contain the right service and that's why the calculator doesn't work anymore for international queries.
As for US domestic queries, the available services look like this:
Priority Mail 2-Day<sup>™</sup>
The trademark is being displayed incorrectly but I don't know how to fix it.
I tried the classic: $key = str_replace('<sup>™</sup>', "", $key); but for some reason it doesn't work. If I try to str_replace something else, like "Priority Mail", it works. It just doesn't work for the trademark sign.
Any ideas on how to replace those characters and how to find out what's the new name for the First Class Package International service?:)

array_push($allowed_types, "First-Class Package International Service&lt;sup&gt;&#8482;&lt;/sup&gt;**");
Web Tools APIs

Related

Amazon PA API5 - new product link structure for affiliates?

We have been Amazon's affiliate for a little while (not long) and we are now starting implementing PA API 5.0.
Up till now, we used to build our affiliate referral links to the products through our CMS following this structure below:
amazon.com/[product-slug]/dp/[ASIN-code]/ref=nosim&tag=[our-affiliate-tag-code]
(variables between square brackets)
The links that are being fed to us through the PA API 5.0 (via scratch pad for now), however, have a different structure:
amazon.com/dp/[ASIN-code]?tag=[our-affiliate-tag-code]&linkCode=osi&th=1&psc=1
The ASIN and our tag are still there, of course, but what about the other codes? What about the ref=nosim as opposed to the new linkCode=osi&th=1&psc=1 ???
Is the former URL structure still valid? Would it still assign the sale as a valid sale for keeping access to the API? Do we need to replace all our old links?
Please advise. Thanks,
David

Satispay without specifying the phone number

I'm adding Satispay as a payment type on a platform but they need a phone number (the payment is based on that).
They have a JS script that shows a popup asking for the phone number but they still need one before opening it and I don't want to ask the user their number on my platform (I think is scary to give away my phone number on an unknown website and I don't think it is only me).
This is the documentation but I can't find anything about it.
Is there anyone who achieved that?
I'm Alessio from Satispay.
As you can see in the documentation data-phone parameter is not mandatory, here you can find an updated code example.
I've just get that my autocorrector changed Satispay in Satisfy ... anyway the Satispay's docs are wrong, you don't need to pass a phone number using the Web Button:
<script src="https://staging.online.satispay.com/checkout.min.js" class="satispay-button"
data-key="your_key"
data-amount='100'
data-description="My Company"
data-phone=""
data-usercallback="https://url_to_create_the_charge"
data-callback="js_function?transactionID=your_id_you_need"
data-orderid="the_order_id"
id="satispay"></script>
That is the correct way to create a Satispay Web Button call. DO NOT FOLLOW THEIR DOCUMENTATION (not until today) BUT USE THIS CODE!

Making my agent with a difficult name, easier to invoke?

I'm creating an agent that interacts with an API I created, Auroras.live. However I always have troubles invoking the test version of the agent from my Google Home.
I really have to stress the "S" in Auroras, and I also have to say "dot", otherwise Google Home interprets it (I think) as Auroras Live, or Aurora.live, without the dot or "S"
This is definitely going to be a problem for others too, as they might not know to pronounce the dot, or forget to stress the "S", and as a result will get frustrated & not use my agent.
While filling out the app details, I tried using different invocations (such as "Talk to Auroras dot live" and "Speak to Aurora Live"), but it wouldn't let me do it, because I needed to use the exact title of my app.
What should I do? Should I (or can I) submit it as an easier to pronounce name (like "the aurora app")? Can I somehow tell Google to accept it with or without the "S" / dot? Any suggestions welcomed.
This is definitely a case where you would want your invocation name to be (slightly) different than your display name. I would list "Auroras Live" as your display name and "Aurora live" as the invocation name.
As part of the testing instructions, explain the problems you're seeing to the tester and request that both invocations be allowed.
If you want to clearly associate it with the auroras.live website, you could also mention that in the testing instructions (to include the dot), but you should probably also consider including a link to the site from the description and possibly from the action itself.

Version number issue while submmiting app on appstore

I want to submit my app on app store.All step i understand well But little confusing about version Number.I have following query.
1- Is it compulsory to put version number numeric only like e.g- 1.0,1.1 etc?
2- Can we put any text instead numeric value on the version number like e.g- hair style, maintain body?
Thanks in advance.
Here is the guide
It says this about the version number:
Numbering should follow typical software versioning conventions (for example, 1.0 or 1.0.1, or 1.1).
"MyApp v.maintain body" makes no sense and cannot be compared for update notifications, etc.

How can I download Yahoo Groups?

I want to download some Yahoo Groups (files, photos, messages, memberlist) and I've found these scripts:
http://freshmeat.net/projects/grabyahoogroup/
http://sourceforge.net/project/showfiles.php?group_id=62034
I've downloaded ActivePerl and the needed modules from CPAN (nothing fancy; they're very easy to find). I've managed to install them, but when I run the script I get an error after it tells me that I've successfully logged in:
"Use of uninitialized value $cells in pattern match (m//) at yahoogroups_files.pl line 244, line 2."
I'm guessing that Yahoo changed the layout of the page or something, but I'm not able to update the script myself. I'm a newbie when it comes to Perl and understanding the way Yahoo generates the pages, I only know some basic C++. I want to mention that I'm not lazy, I'll try do fix it myself but I need your help: hints, advice, anything.
PS: I've contacted the author, but he isn't willing to update the scripts.
You would need knowledge in the following fields:
use of an html parser
http knowledge ( get/post/head )
web scraping
I suggest you focus on WWW::Mechanize since it's capable of all these things ( and more )
EDIT: another solution ( that doesn't need programming ) , is this: login with your browser on yahoo groups, store the cookie, and then run wget , passing the stored cookie as a parameter. This way you'll get the task accomplished very fast.
Find your browser's cookies.txt file on your harddrive, and then call wget like this ( if I remember the commands correctly ) :
wget --load-cookies path_to_cookie_file -r -w 60 website
The full man page can be found here
EDIT2: Another option is to use WebDriver to automate firefox. You can use this article as a guide on how to accomplish this.
By the filename I'm assuming you're using Yahoo Group archiver found here: http://sourceforge.net/projects/grabyahoogroup/
I ran the files script against the SubEthaEdit group and it works great. All of the files downloaded without incident.
Looking at the code it seems to barf while processing an html table in a while loop if $cells is empty.
Considering the code did work when I tested it it's possible there's something going on with the listing of that group's files. You'll want to try outputting $content and figure out where and why the regular expression on 243 isn't able to process that html.
EDIT: If you don't mind posting the group this is happening with I'm sure myself or someone else here can try it out and troubleshoot on their own. It's tough to pinpoint what's up when the issue can't be duplicated. Also, try the same group I did and see if it works out for you. Certainly something up with the group you're trying if that works.
Dunno if it will help you, but here's what I did to get the message-download working:
http://sourceforge.net/forum/forum.php?thread_id=3283915&forum_id=209170
(I only used message-download, I didn't look at file-download)
Was tinkering on this a while ago to backup my girlfriend's group messages and files from uni. Upon debugging on the latest scripts I've found out that there seems to be a bug on group_domain declaration (theres also a group declaration bug that i've found on yahoo2maildir.pl of the same project, see $request)
($group_domain) = $url =~ /\/\/(.*?groups.yahoo.com)\//;
in this case, i've overwritten the $request var under the function sub download_folder() with
from <br>
$request = GET "http://$group_domain/group/$group/files$sub_folder/";
<br> to <br>
$request = GET "http://**groups.yahoo.com/group/$user_group**/files$sub_folder/";
grabyahoogroup works well in the latest edition, which can be found at the svn repo:
http://grabyahoogroup.svn.sourceforge.net/viewvc/grabyahoogroup/trunk/yahoo_group/
The version at sourceforge.net/projects/grabyahoogroup/files/ HAS BUGS AND DID NOT WORK FOR ME.
I've been looking for a tool that collects messages/conversations from Yahoo Groups!. I finally found this tool that converts your Yahoo! Groups messages into MBOX format after struggling to try to make my own and searching everywhere on the internet.
Download tools
Both of the following are Google Chrome extensions.
Chrome Extension to Download Members posted by Sam Hobbs (2015).
Chrome Application To Download Messages posted by Mark Fletcher (Jan 2016).
Plain string to Base64 binary data
At some time past September 16, 2010 (at least for me), the messages retrieved are no longer plain text and instead Base 64 binary data (ASCII). Using this swiss converter tool can allow you to read the data as it is.
Sample content from the MBOX format
VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4=
Sample result after conversion
The quick brown fox jumps over the lazy dog.
for cause, as of 2019/09
https://github.com/csaftoiu/yahoo-groups-backup
.....