I am using this SDK - https://github.com/evernote/evernote-cloud-sdk-php
I can find notes in the my own notebooks, something like this:
$client = new \Evernote\Client($token, false);
$search = new \Evernote\Model\Search('*');
$notebook = $client->getNotebook('notebook_id');
$scope = \Evernote\Client::SEARCH_SCOPE_ALL;
$order = \Evernote\Client::SORT_ORDER_REVERSE | \Evernote\Client::SORT_ORDER_RECENTLY_CREATED;
$results = $client->findNotesWithSearch($search, $notebook, $scope, $order, 20);
It works, but if I try get notes from linked notebooks, it get empty result all time.
Tried implement this - https://dev.evernote.com/doc/articles/sharing.php
$adClient = new \Evernote\AdvancedClient($token ,false);
$store = $adClient->getSharedNoteStore('linked_notbook_id');
$client = new \Evernote\Client($store->getToken(), false);
$search = new \Evernote\Model\Search('*');
$notebook = $carrier->getLinkedNotebooks()[0];
$scope = \Evernote\Client::SEARCH_SCOPE_ALL;
$order = \Evernote\Client::SORT_ORDER_REVERSE | \Evernote\Client::SORT_ORDER_RECENTLY_CREATED;
$results = $client->findNotesWithSearch($search, $notebook, $scope, $order, 20);
The same, empty result.
Where did this $carrier come from?
$notebook = $carrier->getLinkedNotebooks()[0];
Assuming it's $client, LinkedNotebook from the SharedNoteStore is assigned to $notebook and it is passed to findNotesWithSearch, which doesn't seem right.
The LinkedNotebook object is for the user who is shared a notebook with. So calling that API with SharedNoteStore is probably not what you want. See https://dev.evernote.com/doc/articles/sharing.php
The type of second argument of findNotesWithSearch is Notebook. notebookGuid can be found in SharedNotebook.
Related
Based on this sample code, on Joomla 3.9.5
$app = JFactory::getApplication();
$getTemplateId = $app->getTemplate('template')->id;
I'm trying to get template author and license from the XML/SQLdb
$app = JFactory::getApplication();
$getTemplateAuthor = $app->getTemplate('template')->author;
$getTemplateLicense = $app->getTemplate('template')->license;
This of course doesn't work so I would be happy with any suggestion.
After investigating the database in phpMyAdmin, I came up with this solution
// get app
$app = JFactory::getApplication();
// get template
$templateName = $app->getTemplate();
// hook Joomla Database API
$db = JFactory::getDbo();
// set query
$db->setQuery("SELECT manifest_cache FROM #__extensions where `type` = 'template' AND `element` = '".$templateName."'");
// extract the manifest_cache column
$templateMETA = $db->loadObject()->manifest_cache;
// decode JSON and build an object
$templateMETA = json_decode( $templateMETA );
// set author&license
$author = $templateMETA->author;
$license = $templateMETA->license;
The manifest_cache holds the template and possibly any Joomla extension meta information.
Hope this helps someone.
I want to get 28,000 records data from external API.
For this, I use nusoap_client. However, when I test it I don't get any data and I don't get any error.
This is my function:
public function get_all(){
$url = "http://xxx.xx.x.xx:xxx/services/Pending?wsdl";
$client = new \nusoap_client($url, 'wsdl');
$pDate = isset($_GET["Date"]) ? $_GET["Date"] : '26/2/2017 01:01:01';
$operation = 'getPendingData';
$param1 = array(
'Date' => $Date,
);
$result = $client->call($operation, $param1);
print_r($result);
exit();
}
In the API I must get data starting from 26/02/2017 01:01:01. When I test it I don't get any data. When I changed date to 27/02/2017 01:01:01 I got 759 records data.
How to fix this?
hi i use TwitterAPIExchange to follow users
i use this code to create friendships
$url_follow = 'https://api.twitter.com/1.1/friendships/create.json';
$requestMethodd = 'POST';
$fields = array('user_id'=> $response);
$twitter = new TwitterAPIExchange($settingss);
$responsee = $twitter->setPostfields($fields)->buildOauth($url_follow, $requestMethodd)->performRequest();
print_r($responsee);
$response is array contain ids
{"errors":[{"code":108,"message":"Cannot find specified user."}]}
why??
i need use array not id
Here is my code
$objLogParameter = new LogParameters();
$objLogParameter->strLogMessage = $message." ".$extendedMessage;
$objLogParameter->strStackTrace = $preStackTrace;
$objLogParameter->strUser = "Osmosys";
$objLogParameter->strCustomer = "ws";
$objLogParameter->strPageOrModuleName = "calling ws";
$objLogParameter->strApplication = "OsmTest";
$objLogParameter->strSubscription = "test2";
$objLogParameter->EnumSeverity = "Error";
$objLogParameter->EnumLogType = "ErrorTest";
$url = "http://log.cocoonit.in/writelogsindbservice.asmx?WSDL";
$client = new SoapClient($url, array("trace" => 1));
$res = $client->WriteLogInDB($objLogParameter);
WriteLogInDB is a method in .asmx webservice, thats method except an object as a argument then if i pass a object in $res i got a msg like status code = 0,object couldn't be empty.
I want to connect this Url
http://log.cocoonit.in/writelogsindbservice.asmx
and in this it have a WriteLogInDB method, i want to call this method by passing an object nothing but $objLogParameter. how can i do it in php.
Please help me.
I am trying to develop a script (using the PHP example app as a basis) that will post a note to Evernote based on GET values.
When I insert this to the end of functions.php's listNotebooks()
$note_obj = new Note(array(
'contents' => $note_contents,
'title' => $title
));
It throws a 500 error. (In my code, $title & $note_contents are defined earlier. I have spent a lot of time trying to find proper documentation for the PHP API but it just seems non-existent. Any information on this topic would be greatly appreciated
Update: I did not realize the API was using PHP Namespaces: This fixed the issue:
//import Note class
use EDAM\Types\Note;
use EDAM\Types\NoteAttributes;
use EDAM\NoteStore\NoteStoreClient;
My code to add a note still does not work but I'll post it here once I figure it out.
These classes need to be imported:
//import Note class
use EDAM\Types\Note;
use EDAM\Types\NoteAttributes;
use EDAM\NoteStore\NoteStoreClient;
This will define our new note:
$noteAttr = new NoteAttributes();
$noteAttr->sourceURL = "http://www.example.com";
$note = new Note();
$note->guid = null;
$note->title = "My Title";
$note->content = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd"><en-note>My Content</en-note>';
$note->contentHash = null;
$note->contentLength = null;
$note->created = time()*1000;
$note->updated = time()*1000;
$note->deleted = null;
$note->active = null;
$note->updateSequenceNum = null;
$note->notebookGuid = null;
$note->tagGuids = null;
$note->resources = null;
$note->attributes = $noteAttr;
$note->tagNames = null;
addNote($note);
This function will add a new note:
function addNote($newnote) {
global $noteRet;
if (empty($noteRet)) {
define("noteStoreHost", "sandbox.evernote.com");
define("noteStorePort", "80");
define("noteStoreProto", "https");
define("noteStoreUrl", "edam/note/");
$noteStoreTrans = new THttpClient(noteStoreHost, noteStorePort, noteStoreUrl . $_SESSION['shardId'], noteStoreProto);
$noteStoreProt = new TBinaryProtocol($noteStoreTrans);
$noteStore = new NoteStoreClient($noteStoreProt, $noteStoreProt);
$noteRet = $noteStore->createNote($_SESSION['accessToken'], $newnote);
return $noteRet;
}
}