Post to my Facebook page (not user status ) - vb.net

I have now spend the weekend trying to figure out how to post a status update to a facebook page (not user ) with out any luck (Yes my wife is angry Wink | ;-) .
Looks like on the net there is no working example.
This is what I got so far is:
Dim fb = New FacebookClient()
fb.AppSecret = app_secret
fb.AppId = app_id
Dim result = fb.[Get]("oauth/access_token", New With {Key .client_id = app_id, Key .client_secret = app_secret, Key .grant_type = scope, Key .redirect_uri = Url})
fb.AccessToken = result.access_token
fb.Post("/me/feed", New With {Key .message = "My first post"})
But still no luck , anybody how can point me in the right direction , and please also include info how to get the access token.
Ps. Im using the facebook-csharp-sdk
Thanks alot

Please refer to this document right here: "https://developers.facebook.com/docs/wordpress/" which explains the Wordpress plugin and how to use your app to post to your own Facebook page (this is very similar to your case). Hope this helps!

Related

Rally API Fetch All Features under specific Epic

Hi I cannot find this anywhere and it seems so easy.
I am trying to get All the Features under specific Epic with Alteryx.
I am using this to get them all, but I want to make more precise.
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature?pagesize=2000
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/....
Can anyone help please?
Got another solution but it is still not perfect:
First I am getting SubEpics
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/subepic?pagesize=2000&&start=1&query=(Parent.FormattedID = E101)
And then Features:
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature?pagesize=2000&query=(((Parent.FormattedID = SE104) OR (Parent.FormattedID = SE101)) OR ((Parent.FormattedID = 102) OR (Parent.FormattedID = 103)))
OK! Correct answer for Feature is :) Got it with help from SAGI GABAY from CA:
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature?pagesize=2000&&start=1&query=(Parent.Parent.FormattedID
= E101)
I have also asked about the User Stories level and going this way (Parent.Parent.Parent.FormattedID) doesn't work anymore but you can do this:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?pagesize=2000&&start=1&query=(Feature.Parent.FormattedID = SE101)

What is the best way to call channel9 api for getting video?

Lets say that i have URL to channel9 movie;
Ex: https://channel9.msdn.com/Series/Office-365-Tips--Tricks/01-Wprowadzenie
And I want to display this movie on my site, and display some information for it ex. duration.
All what I know already is that, I can get list of movies by calling
https://channel9.msdn.com/odata/Entries and skipping it +25 for showing next 25 results.
My implementation right now is something like:
Get first 25 elements from api
Iterate throught them
compare my url with elementFromApi[i].url
Its working but I don't like this solution, it is non elegant and slow as hell. I have no knowledge about the api so i dunno know how to refactor this^.
Maybe someone of You can help me.
PS. I need information from api, embed iframe with given url is not the solution here :)
PS2. Sorry for my english.
I got this requirement through my client and I ended up doing it using RSS! In your use case the URL is https://channel9.msdn.com/Series/Office-365-Tips--Tricks/01-Wprowadzenie - Simply we can read the rss by using the link https://s.ch9.ms/Series/Office-365-Tips--Tricks/rss/mp4 - In PowerShell we can explore the content with the below piece of code
$Sessions = Invoke-Restmethod -Uri 'https://s.ch9.ms/Series/Office-365-Tips--Tricks/rss/mp4' -UseDefaultCredentials
foreach($Session in $Sessions) {
$Duration = [timespan]::FromSeconds($Session.duration)
[pscustomobject]#{
Title = $Session.title
Duration = ("{0:0}:{1:00}:{2:00}" -f ($Duration.Hours , $Duration.Minutes , $Duration.Seconds))
Creator = $Session.creator
"URl(MP3)" = $Session.group.content.url[0]
"URl(MP4)" = $Session.group.content.url[1]
"URl(webm)" = $Session.group.content.url[2]
"URl(MP4High)" = $Session.group.content.url[3]
}
}
Note: Code needs to be improvised!
The same can be achieved using C# - But I am not a certified developer - So , I used PowerShell to meet client requirement.

Python: simplemysql wrapper. Weird (no) Data transfer

I need to say, that i actually learn programming and i try to solve this (propably) simple problem since hours. I want to check if a username already exists and if so, print a message, else write the Data for the new user into the DB. The script (check = db.getOne...) always returns "None" but read = db.getOne seems to read the Data. Where is the difference between them?
The query read = db.getOne("upers", ["logn"]) receives Data, but there is no Data saved in the DB. How can it be and how can i avoid the "None" problem and instead find the user? Sorry if my question seems crazy and like a spaghetti question, but im new to python (and stack overflow). Thanks in Advance for any Hints and Help!
The script:
import MySQLdb
from simplemysql import SimpleMysql
#Dokumentation: http://nadh.in/code/simplemysql/
db = SimpleMysql(
host='localhost',
user = '1234',
db = 'name',
passwd = '1234',
keep_alive=True
)
def createu(u, p, m):
username = u
password = p
mail = m
check = db.getOne("upers",
["logn"],
("logn = %s", [username])
)
print check
if check == None:
db.insert("upers",
{"logn": username, "pw": password, "mail": mail}
)
print "seems to work!"
else:
print "something is wrong!"
check = 0
u='test'
p = 'lol'
m = '123#lol.de'
createu(u, p, m)
read = db.getOne("upers", ["logn"])
print read
The Output:
None
seems to work!
Row(logn=u'test')
Also i cant imagine how the u finds its way into the output of the sql query.
I had many different approaches to get a simple database up and running and the simplesql wrapper seems to fit really good for a beginner like me, so i hope someone can point me in the right direction.
edit: It seems the data isn't even saved in the DB. When i log in to phpmyAdmin it cant find any data in the DB. But how can it be that i am able to read the Data with python? Magic?! oO
Another important question for me is: How can i extract the information from the print read result: Row(logn=u'test')

Get all QuickBooks Online accounts regardless of active status

I'm trying to retrieve all the accounts from a company by using the DataService.FindAll(...) method but it only seems to be returning active accounts. Is there a way to get all the accounts regardless of the active status?
I know I've got inactive accounts because I purposely put them there to test and such.
My current line looks like this:
Dim accounts As List(Of Intuit.Ipp.Data.Account) = ds.FindAll(New Intuit.Ipp.Data.Account()).ToList()
I've also tried adding a ... With {.Active = False}... in there too just to see if that would find all that are inactive. Still nothing.
Am I overlooking something or should this work and get me all accounts?
Thanks for any help.
Also, I'm using Intuit's .NET SDK with VB.NET.
You can try this -
SELECT * FROM Account WHERE Active IN (true, false)
ApiExplorer - https://developer.intuit.com/apiexplorer?apiname=V3QBO#Account
JAVA Code
Account account = GenerateQuery.createQueryEntity(Account.class);
String accountQuery = select($(account)).where($(account.isActive()).in(new Boolean[]{true, false})).generate();
service.executeQuery(accountQuery);
Thanks

Increment user postcount upon posting topic/reply

I'm really new to SQL and looked around the web for help on incrementing values but couldn't find something that works for me. What I'm trying to do is increment the value of user_posts when a reply/topic is posted. The user_posts is in users (forums>users>user_posts). I don't know how to get the specific user and then add to the value of his/her posts. I'm working off of a very small and basic example, which is how I have posts working. I was thinking I could add it to the SQL where the topic is sent to the DB but, like I said, can't figure out how. I don't really have any code to provide to start with because I really don't know where to start. I believe it uses UPDATE, but that's all I can guess. If you aren't quite sure what it is I want even after reading all of this, ask and I'll try to clarify.
Here's what it looks like with part of the working post code and a suggested code that doesn't seem to work.
VALUES ('" . $_POST['reply-content'] . "',
NOW(),
" . mysql_real_escape_string($_GET['id']) . ",
" . $_SESSION['user_id'] . ");
UPDATE users SET user_posts=1 WHERE user_id=1";
You can write
UPDATE Users
SET PostCount = PostCount + 1
WHERE UserId = #id
Something like: select postcount from users where user_id = <userid>; followed by update users set postcount=<new_postcount> where user_id = <userid>;. Some details: http://www.w3schools.com/sql/sql_update.asp
I wouldn't worry about optimizing your queries to your database until you experience problems handling your load. :)